I am trying to log whenever a user does something into a log file, with the date included, however when I do this, at the beginning of each log, I get a strange symbol.
char log[200];
char datetime[200];
time_t now = time(NULL);
strftime(datetime,200,"%x %X", localtime(&now));
strcat(log,datetime);
sendline[strlen(sendline)-1] = 0;
strncat(log," - ",3);
strcat(log,sendline);
recvline[strlen(recvline)-1] = 0;
strncat(log," - ",3);
strcat(log,recvline);
strncat(log,"\n",1);
fprintf(fp,"%s",log);
This is the symbol I am getting with each entry
How can I solve this and why is it happening?