My application falls over when I make the following call to strcat any ideas why?
char *encryptedLine[255] = {0};
char encryptedLString[8];
sprintf(encryptedLString, "%08lX", L);
strcat(*encryptedLine, encryptedLString);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
*encryptedLineis NULL pointer: it needs to point acharbuffer.*encyptedLineis equivalent toencryptedLine[0], which is the first entry in the array ofchar*encryptedLine:which is a NULL pointer.
To fix, either change to:
or:
I think you also need to increase the size of
encryptedLStringby 1 as:will attempt to write 9 characters: 8 specified by the format plus 1 for the null terminator: