Skip to content

Commit

Permalink
-Fix: int argument to sprintf() because of integer promotion
Browse files Browse the repository at this point in the history
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 a4787e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a4787e1

Please sign in to comment.