| [ CnUnix ] in KIDS 글 쓴 이(By): guest (guest) <61.33.171.194> 날 짜 (Date): 2002년 7월 31일 수요일 오후 04시 01분 30초 제 목(Title): [질문]다음과 같은 c code에서 문제점. 에러가 발생하여 gdb로 찾아보니, 아래에 함수에서 segment fault가 발생했습니다. 발생된 곳은 라인은 제 소스에서는 tm_ptr = localtime( &the_time ); 이며, 이 함수내에서 #0 0x480f1c51 in offtime () from /usr/lib/libc_r.so.4 #1 0x480f17a9 in tzset () from /usr/lib/libc_r.so.4 #2 0x480f1904 in localtime () from /usr/lib/libc_r.so.4 #3 0x8050e00 in getDate () 입니다. void getDate( char *dateBuf_, int bufSize_ ) { struct tm *tm_ptr; time_t the_time; (void)time(&the_time); tm_ptr = localtime( &the_time ); strftime( dateBuf_, bufSize_, "%Y%m%d", tm_ptr ); return; } 제가 보기에는 아무런 문제가 없는데... 왜 그럴까요? 구현 환경은 프비 4.5입니다. |