Skip to content
Permalink
Browse files

-Fix: int argument to sprintf() because of integer promotion

src/gui/gui.c:3140:26: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
    sprintf(key, "REG%hu", i + 1);
  • Loading branch information...
miniupnp committed Feb 28, 2019
1 parent 5ded82e commit a4787e16225e00810603404d95ff71f1cc302dd1
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/gui/gui.c
@@ -3137,7 +3137,7 @@ static uint16 GUI_StrategicMap_ScenarioSelection(uint16 campaignID)
for (i = 0; i < 20; i++) {
char buffer[81];

sprintf(key, "REG%hu", i + 1);
sprintf(key, "REG%hu", (uint16)(i + 1));

if (Ini_GetString(category, key, NULL, buffer, sizeof(buffer) - 1, g_fileRegionINI) == NULL) break;

0 comments on commit a4787e1

Please sign in to comment.
You can’t perform that action at this time.