From 823b81363a1145de4b8660153007b11faf4e2c56 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Thu, 2 Jun 2022 02:43:58 -0700 Subject: web: fix minor mem leaks and bugs --- web/web_opts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/web_opts.c') diff --git a/web/web_opts.c b/web/web_opts.c index b880fd3..18a8c2a 100644 --- a/web/web_opts.c +++ b/web/web_opts.c @@ -19,12 +19,12 @@ static int difficulty = 32; static void set_delay(char *val) { - delay_ms = atoi(val); + delay_ms = val ? atoi(val) : 0; } static void set_difficulty(char *val) { - int diff = atoi(val); + int diff = val ? atoi(val) : 0; difficulty = diff < 0 ? 0 : diff > 99 ? 99 : diff; comp_set_difficulty(difficulty); -- cgit v1.2.3-70-g09d2