From: Holger Schemel Date: Tue, 27 Jun 2017 20:40:25 +0000 (+0200) Subject: fixed potentially disastrous bug that could crash the program X-Git-Tag: 4.0.1.0~39 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9ce9093cf129a329ed897f576000de8314ed8f59;p=rocksndiamonds.git fixed potentially disastrous bug that could crash the program --- 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);