![]() |
Concat string (not ended ...)
hi
i tried to concat some string (not ended, can use strcpy, strcat...) Code:
void analyzeFilename(char *filename, int size, char *led_line) but when i display p, i get bullshit... Code:
printf("msg complet: %s\n", p); Code:
msg complet: ÿôÿóècÿôÈ |
You should check to see where p is pointing after all those memcpy()'s. It's pointing to memory right after the string. Maybe you should be printing ALL instead? Also, CMD_END isn't nul-terminated so you shouldn't be trying to print it anyway. Besides, CMD_INIT starts with a '\0' so it will end up printing nothing since it thinks ALL is an empty string.
|
itsme is correct in that you should be printing from ALL, not p. The issue is that the code is increasing the memory location of p each time it executes:
Code:
p += sizeof(???); I don't know if that's what you meant to do. |
All times are GMT -5. The time now is 01:44 PM. |