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

}

}