xenos
Full Member level 4
- Joined
- May 9, 2015
- Messages
- 212
- Helped
- 82
- Reputation
- 164
- Reaction score
- 81
- Trophy points
- 28
- Location
- 127.0.0.1
- Activity points
- 1,182
The sprintf function uses variable argument list (va_start,va_arg,va_end...).
It seems that the sprintf pops from the stack 2bytes (0xba, 0xdc, 0x?0, ...) for each %c.
That meens that it thinks that every char has 2 byte width.
It may be an option of the compiler or you may have wrong library version.
Try this code and tell me the results:
It seems that the sprintf pops from the stack 2bytes (0xba, 0xdc, 0x?0, ...) for each %c.
That meens that it thinks that every char has 2 byte width.
It may be an option of the compiler or you may have wrong library version.
Try this code and tell me the results:
Code:
sprintf(txt,"%c %c %c %c\r\n",(int)a,(int)b,(int)c,(int)d);