Mail Archives: djgpp/1998/04/11/09:45:37
I receive a General Protection Fault when calling sprintf() - but only
if I have run another function before. Here´s the code :
void abc(int nr)
{
char tstr[50];
... some strcpy/strcat´s
sprintf(tstr, "%d", nr); <- General Protection Fault
}
The error only occurs if I have run another function before (a sort of
menu-system... it uses some inline asm functions (but these functions
are used elsewhere throughout the game)).
I assume that the error lies in that I clobber some register or
something somewhere before... Is there anything special I should
think about when doing inline asm? (for example, is it possible
to declare any clobbered segment-registers?)
- Raw text -