1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
|
Desription: After enabling hardening flags, sever warnings turned to errors.
This patch fixes those errors. Mosty format string issues.
Author: Barry deFreese <bdefreese@debian.org>
Index: overgod-1.0/displ_in.c
===================================================================
--- overgod-1.0.orig/displ_in.c 2013-08-02 12:46:32.000000000 -0400
+++ overgod-1.0/displ_in.c 2013-08-02 13:12:48.807121062 -0400
@@ -1298,7 +1298,7 @@
rectfill(screen, 400, 117, 450, 118, COLOUR_YELLOW8);
rectfill(screen, 449, 117, 450, ypos + 5, COLOUR_YELLOW8);
hline(screen, 449, ypos + 5, 433, COLOUR_YELLOW8);
- textprintf_right_ex(screen, small_font, 430, ypos, COLOUR_GREEN8, -1, progtxt);
+ textprintf_right_ex(screen, small_font, 430, ypos, COLOUR_GREEN8, -1, "%s", progtxt);
ypos += 11;
// do {rest(30);} while (!key [KEY_X]);
// rest(200);
Index: overgod-1.0/display.c
===================================================================
--- overgod-1.0.orig/display.c 2005-09-11 05:42:46.000000000 -0400
+++ overgod-1.0/display.c 2013-08-02 13:19:39.977159944 -0400
@@ -1672,9 +1672,9 @@
char dstr [30];
secondary_name(actor[a].secondary, dstr);
if (game.users == 1)
- textprintf_ex(bmp, small_font, x + 250, y + 20, COLOUR_YELLOW6, -1, dstr);
+ textprintf_ex(bmp, small_font, x + 250, y + 20, COLOUR_YELLOW6, -1, "%s", dstr);
else
- textprintf_ex(bmp, small_font, x + 220, y, COLOUR_YELLOW6, -1, dstr);
+ textprintf_ex(bmp, small_font, x + 220, y, COLOUR_YELLOW6, -1, "%s", dstr);
}
@@ -6744,7 +6744,7 @@
circle(bmp, x, y, 3 + x2 / 2, x1);
drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0);
secondary_name(pickup[dr].subtype, dstr);
- textprintf_centre_ex(bmp, small_font, x, y + 12, COLOUR_GREY3, -1, dstr);
+ textprintf_centre_ex(bmp, small_font, x, y + 12, COLOUR_GREY3, -1, "%s", dstr);
break;
case PICKUP_SECONDARY:
x1 = TRANS_DGREY;
@@ -6760,7 +6760,7 @@
drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0);
circlefill(bmp, x, y, 3 + pulsate(64, 2, counter), COLOUR_YELLOW4 + pulsate(64, 3, counter));
secondary_name(pickup[dr].subtype, dstr);
- textprintf_centre_ex(bmp, small_font, x, y + 12, COLOUR_YELLOW4 + pulsate(16, 2, counter), -1, dstr);
+ textprintf_centre_ex(bmp, small_font, x, y + 12, COLOUR_YELLOW4 + pulsate(16, 2, counter), -1, "%s", dstr);
draw_a_light(bmp, 10 + pulsate(64, 5, counter), x, y);
break;
case PICKUP_REPAIR:
Index: overgod-1.0/menu.c
===================================================================
--- overgod-1.0.orig/menu.c 2013-08-02 12:46:32.000000000 -0400
+++ overgod-1.0/menu.c 2013-08-02 13:34:43.089638237 -0400
@@ -1186,7 +1186,7 @@
}
- textprintf_right_ex(menu_bmp, small_font, ox, oys + oy * i, col, -1, ostr);
+ textprintf_right_ex(menu_bmp, small_font, ox, oys + oy * i, col, -1, "%s", ostr);
}
@@ -1390,7 +1390,7 @@
}
- textprintf_centre_ex(menu_bmp, small_font, ox, oys + oy * i, col, -1, ostr);
+ textprintf_centre_ex(menu_bmp, small_font, ox, oys + oy * i, col, -1, "%s", ostr);
}
@@ -1517,7 +1517,7 @@
strcpy(ostr, "Exit");
break;
}
- textprintf_centre_ex(menu_bmp, small_font, ox, oys + oy * i, col, -1, ostr);
+ textprintf_centre_ex(menu_bmp, small_font, ox, oys + oy * i, col, -1, "%s", ostr);
}
@@ -2464,9 +2464,9 @@
// textprintf_ex(menu_bmp, font2, 280, y + 20, COLOUR_WHITE, "%i", ship);
ship_description1(ship, descr_string);
- textprintf_centre_ex(menu_bmp, small_font, 436, y + 70, COLOUR_YELLOW7, -1, descr_string);
+ textprintf_centre_ex(menu_bmp, small_font, 436, y + 70, COLOUR_YELLOW7, -1, "%s", descr_string);
ship_description2(ship, descr_string);
- textprintf_centre_ex(menu_bmp, small_font, 436, y + 80, COLOUR_YELLOW7, -1, descr_string);
+ textprintf_centre_ex(menu_bmp, small_font, 436, y + 80, COLOUR_YELLOW7, -1, "%s", descr_string);
/*
int line_colour = 255;
int box_colour = 255;
@@ -2586,7 +2586,7 @@
col = COLOUR_YELLOW4 + (menu_counter / 4) % 4;
strcpy(sstr, hs_single[i].name);
- textprintf_ex(menu_bmp, small_font, ox, oys + oy * i, col, -1, sstr);
+ textprintf_ex(menu_bmp, small_font, ox, oys + oy * i, col, -1, "%s", sstr);
if (hs_single[i].level == 16)
strcpy(sstr, "<V>");
@@ -2596,7 +2596,7 @@
strcpy(sstr, "");
anum(sstr, hs_single[i].level);
}
- textprintf_right_ex(menu_bmp, small_font, ox + 90, oys + oy * i, col, -1, sstr);
+ textprintf_right_ex(menu_bmp, small_font, ox + 90, oys + oy * i, col, -1, "%s", sstr);
// strcpy(sstr, ship_name_short(hs_single[i].ship));
// textprintf_right_ex(menu_bmp, small_font, ox + 190, oys + oy * i, col, -1, sstr);
@@ -2609,7 +2609,7 @@
rank_name(get_rank(hs_single[i].score, hs_single[i].level), sstr);
if (hs_single[i].level == 16)
col = COLOUR_YELLOW8;
- textprintf_ex(menu_bmp, small_font, ox + 220, oys + oy * i, col, -1, sstr);
+ textprintf_ex(menu_bmp, small_font, ox + 220, oys + oy * i, col, -1, "%s", sstr);
}
@@ -2636,7 +2636,7 @@
col = COLOUR_YELLOW4 + (menu_counter / 2) % 4;
strcpy(sstr, hs_coop[i].name);
- textprintf_ex(menu_bmp, small_font, ox, oys + oy * i, col, -1, sstr);
+ textprintf_ex(menu_bmp, small_font, ox, oys + oy * i, col, -1, "%s", sstr);
if (hs_coop[i].level == 16)
strcpy(sstr, "<V>");
@@ -2652,7 +2652,7 @@
textprintf_right_ex(menu_bmp, small_font, ox + 106, oys + oy * i, COLOUR_WHITE, -1, "v");
if (game.mode_god == 1)
textprintf_right_ex(menu_bmp, small_font, ox + 114, oys + oy * i, COLOUR_WHITE, -1, "g");*/
- textprintf_right_ex(menu_bmp, small_font, ox + 90, oys + oy * i, col, -1, sstr);
+ textprintf_right_ex(menu_bmp, small_font, ox + 90, oys + oy * i, col, -1, "%s", sstr);
// strcpy(sstr, ship_name_short(hs_coop[i].ship));
// textprintf_right_ex(menu_bmp, small_font, ox + 190, oys + oy * i, col, -1, sstr);
@@ -2665,7 +2665,7 @@
if (hs_coop[i].level == 16)
col = COLOUR_YELLOW8;
rank_name(get_rank(hs_coop[i].score, hs_coop[i].level), sstr);
- textprintf_ex(menu_bmp, small_font, ox + 220, oys + oy * i, col, -1, sstr);
+ textprintf_ex(menu_bmp, small_font, ox + 220, oys + oy * i, col, -1, "%s", sstr);
}
@@ -3592,7 +3592,7 @@
if (key [i] != 0)
{
scancode_to_keyname(i, sstr);
- textprintf_ex(menu_bmp, small_font, 200, 250 + row * 10, COLOUR_ORANGE8, -1, sstr);
+ textprintf_ex(menu_bmp, small_font, 200, 250 + row * 10, COLOUR_ORANGE8, -1, "%s", sstr);
row ++;
}
}
Index: overgod-1.0/tile.c
===================================================================
--- overgod-1.0.orig/tile.c 2005-09-11 03:35:48.000000000 -0400
+++ overgod-1.0/tile.c 2013-08-02 13:35:09.693770159 -0400
@@ -1104,7 +1104,7 @@
void tile_progress_update(const char progtxt [])
{
static int ypos = 10, xpos = 10;
- textprintf_centre_ex(screen, small_font, 320, ypos, COLOUR_GREEN8, -1, progtxt);
+ textprintf_centre_ex(screen, small_font, 320, ypos, COLOUR_GREEN8, -1, "%s", progtxt);
ypos += 10;
if (ypos > 470)
{
Index: overgod-1.0/stuff.c
===================================================================
--- overgod-1.0.orig/stuff.c 2005-09-11 03:35:48.000000000 -0400
+++ overgod-1.0/stuff.c 2013-08-02 13:36:54.314288945 -0400
@@ -167,7 +167,7 @@
void error_message_out(const char *errm)
{
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
- allegro_message(errm);
+ allegro_message("%s", errm);
exit(1);
}
|