mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 15:29:46 +00:00
test/ref/otccex: Fix ramdomly occurring segfault.
The variables named tab and p are used in the context of pointers and thus must be declared as such. Determining the purpose they serve, using char over int seems more feasible here as well.
This commit is contained in:
parent
83e0c70de5
commit
9faca05e6a
@ -58,7 +58,7 @@ long fact(n)
|
||||
/* Well, we could use printf, but it would be too easy */
|
||||
print_num(long n,int b)
|
||||
{
|
||||
int tab, p, c;
|
||||
char *tab, *p, c;
|
||||
/* Numbers can be entered in decimal, hexadecimal ('0x' prefix) and
|
||||
octal ('0' prefix) */
|
||||
/* more complex programs use malloc */
|
||||
@ -71,7 +71,7 @@ print_num(long n,int b)
|
||||
c = c + 'a' - 10;
|
||||
else
|
||||
c = c + '0';
|
||||
*(char *)p = c;
|
||||
*p = c;
|
||||
p++;
|
||||
n = n / b;
|
||||
/* 'break' is supported */
|
||||
|
Loading…
Reference in New Issue
Block a user