Oki I need to do it to use a given lib so I came out with the following coded wich fails:
Any ideas?Code:#include <stdio.h> #include <stdlib.h> void removeCharSign (unsigned char ubuffer[], char buffer[]) { int i; for( i = 0; i < (int)(sizeof ubuffer / sizeof *ubuffer); ++i) { buffer[i] = ubuffer[i]; } buffer[i] = '\0'; } int main() { unsigned char foo[] = "testcsadfwqoekrwfko"; char bar[30]; removeCharSign(foo,bar); printf("%s\n",bar); return 0; }
It outputs just test