From 6227bdf43872e6288dde6fe1f2ec0f2026b38678 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 20 Mar 2020 21:04:16 +0200 Subject: [PATCH] Prevent setting boulder symbol to a control character --- src/options.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/options.c b/src/options.c index 4570bcf1f..63740330d 100644 --- a/src/options.c +++ b/src/options.c @@ -739,7 +739,10 @@ char *op UNUSED; clash = opts[0] ? 1 : 0; else if (opts[0] >= '1' && opts[0] < WARNCOUNT + '0') clash = 2; - if (clash) { + if (opts[0] < ' ') { + config_error_add("boulder symbol cannot be a control character"); + return optn_ok; + } else if (clash) { /* symbol chosen matches a used monster or warning symbol which is not good - reject it */ config_error_add("Badoption - boulder symbol '%s' would conflict "