acoto87 / war1

A remake of Warcraft: Orcs & Humans written in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

warning: ‘ GOLD & LUMBER’ directive writing 14 bytes into a region of size between 0 and 4

KuriKai opened this issue · comments

after pulling your changes into my branch, then doing a pull to my computer to compile for linux I'm getting the below error(unfortunately, I'm not a programmer so I'm not sure how to fix it)

From https://github.com/KuriKai/war1
1113819..0a15262 master -> origin/master
Updating 1113819..0a15262

In file included from ../../src/war1.c:137:
../../src/war_map.c: In function ‘updateStatus’:
../../src/war_map.c:1599:75: warning: ‘ GOLD & LUMBER’ directive writing 14 bytes into a region of size between 0 and 4 [-Wformat-overflow=]
1599 | sprintf(statusText, "FULL REPAIRS WILL COST %d GOLD & LUMBER", repairCost);
| ~~~~^~~~~~~~~~

../../src/war_map.c:1599:25: note: ‘sprintf’ output between 39 and 49 bytes into a destination of size 28
1599 | sprintf(statusText, "FULL REPAIRS WILL COST %d GOLD & LUMBER", repairCost);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Generating ctags - Start
Generating ctags - Done

I see, thanks for the report.

I know what is happening. I'm doing the cheats feature and I rewrite some parts of the status bar code. I'm going to take a look and fix it in the evening.

I think this is fixed by now, so I'm gonna close it. Feel free to re-open it if is still happening on your end.