64비트는 검증을 통과 했는데 32비트는 통과 못했습니다.
#define LEN 99999+1
#define STRLEN (LEN+1)
int main()
{
//초기화 되지 않은 메모리 할당
char *temp = (char*)malloc(STRLEN);
//char temp[STRLEN];
for (int i = 0; i < LEN; ++i)
{
temp[i] = i % 255 + 1;
#if 1
// 검증
temp[i + 1] = 0;
if (strlen(temp) != strlen_ex1(temp))
{
printf("%d %d \n", sizeof(size_t), sizeof(uint32_t));
printf("length error %d %d\n", strlen(temp), strlen_ex1(temp));
printf("string %s\n", temp);
system("pause");
}
#endif // 1
}
}
검증코드 잘못일수도 있으니 한번 부탁드립니다.
length error 4 7string
http://ideone.com/Cmweyx
이건 검증 통과
처음 올리신건 에러네여
체크 땡큐.~
bsr 전처리를 덜해준듯
고쳐놨다~