From 9ce9093cf129a329ed897f576000de8314ed8f59 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 27 Jun 2017 22:40:25 +0200 Subject: [PATCH] fixed potentially disastrous bug that could crash the program --- src/screens.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/screens.c b/src/screens.c index 3703935f..dbbd5075 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4146,9 +4146,9 @@ void DrawChooseLevelNr() LevelStats_getSolved(i) ? FC_GREEN : LevelStats_getPlayed(i) ? FC_YELLOW : FC_RED); - sprintf(identifier, "%d", value); - sprintf(name, "%03d: %s", value, - (level.no_level_file ? "(no file)" : level.name)); + snprintf(identifier, sizeof(identifier), "%d", value); + snprintf(name, sizeof(name), "%03d: %s", value, + (level.no_level_file ? "(no file)" : level.name)); setString(&ti->identifier, identifier); setString(&ti->name, name); -- 2.34.1