strncpy is not working for me for the following variable. It is working fine elsewhere in the program.
char szQName[21];
strncpy(szQName, "Text", 20);
//debugger shows szQName's value as -88D11B47-8F19-41CA-.
Has it ever happened to anyone?
Details (context of the code):
char szQName[21];
LPSTR szFileName; //Long Pointer to a STRing (char*)
szFileName = malloc(256*sizeof(char));
GTGetUniqueFileName ("", "txt", "TXT", (LPSTR)szFileName);
//now szFileName = TXT-88D11B47-8F19-41CA-B586-9541BAD87CC4.txt
strncpy(szQName, "Text", 20);
//szQName = -88D11B47-8F19-41CA-
why?