[Fix] Fixed a buffer overrun.

This commit is contained in:
Allanis 2014-03-10 14:51:37 +00:00
parent 232499f3c0
commit 15216c7544
2 changed files with 3 additions and 1 deletions

View File

@ -81,7 +81,7 @@ void player_board(void) {
window_addButton(wdw, 20+BUTTON_WIDTH+20, 20, BUTTON_WIDTH, BUTTON_HEIGHT, window_addButton(wdw, 20+BUTTON_WIDTH+20, 20, BUTTON_WIDTH, BUTTON_HEIGHT,
"btnStealCargo", "Cargo", board_stealCargo); "btnStealCargo", "Cargo", board_stealCargo);
window_addButton(wdw, 20+2*(BUTTON_WIDTH+20), 20, BUTTON_WIDTH, BUTTON_HEIGHT, window_addButton(wdw, 20+2*(BUTTON_WIDTH+20), 20, BUTTON_WIDTH, BUTTON_HEIGHT,
"btnStealFuel", "Fuel", board_stealFuel); "btnStealCargo", "Fuel", board_stealFuel);
window_addButton(wdw, -20, 20, BUTTON_WIDTH, BUTTON_HEIGHT, window_addButton(wdw, -20, 20, BUTTON_WIDTH, BUTTON_HEIGHT,
"btnBoardingClose", "Leave", board_exit); "btnBoardingClose", "Leave", board_exit);

View File

@ -1025,6 +1025,8 @@ char* pilot_getOutfits(Pilot* pilot) {
if(pilot->noutfits > 0) if(pilot->noutfits > 0)
snprintf(str, 1024, "%dx %s", snprintf(str, 1024, "%dx %s",
pilot->outfits[0].quantity, pilot->outfits[0].outfit->name); pilot->outfits[0].quantity, pilot->outfits[0].outfit->name);
else
snprintf(str, 1024, "None");
/* Rest of the outfits. */ /* Rest of the outfits. */
for(i = 1; i < pilot->noutfits; i++) { for(i = 1; i < pilot->noutfits; i++) {