Skip to content

Commit

Permalink
snesc: make writenum() handle zero correctly
Browse files Browse the repository at this point in the history
bug spotted by Tomy

Signed-off-by: Ulrich Hecht <uli@suse.de>

git-svn-id: http://snes-sdk.googlecode.com/svn/trunk@64 5e493d80-052e-11de-a3aa-254263d3d64b
  • Loading branch information
ulrich.hecht committed Aug 7, 2009
1 parent 4385559 commit 6928f67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion snesc/str.c
Expand Up @@ -19,7 +19,10 @@ void writenum(unsigned long long num, unsigned char len, unsigned int *map, unsi
{
unsigned char figure;
p += len - 1;
while (len && num) {
if (!num) {
map[p] = offset;
}
else while (len && num) {
figure = num % 10;
if (num || figure) map[p] = figure + offset;
num /= 10;
Expand Down

0 comments on commit 6928f67

Please sign in to comment.