I am getting errors compiling code designed for (I believe) Linux on OSX. I have tracked down the issue to this section of code:
TIMEVAL = time(NULL);
char* TIMESTRING = ctime(&TIMEVAL);
fprintf(LOG, "[ %20s] ", TIMESTRING);
Is there any reason why this might be the case? I have included ``.
Since you are getting a segmentation fault, check whether TIMESTRING is valid or not.
以上就是Seg fault with time and ctime, when porting from Linux to OSX的详细内容，更多请关注web前端其它相关文章！