warning C4996: 'strtok': This function or variable may be unsafe. Consider using strtok_s instead.
위와 같은 경고는 다음과 같이 변경해준다.
변경 전
token = strtok(buff, "#");
token = strtok(NULL, "#");
변경 후
char* context = NULL;
token = strtok_s(buff, "#", &context);
token = strtok_s(NULL, "#", &context);
_tcstok_s의 경우, char*를 LPTSTR로 변경하는 것 외에 동일하다.
0 댓글