Make test files buildable for glibc
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ int main(void) {
|
||||
puts("Correct memrchr");
|
||||
char arr2[51];
|
||||
memset(arr2, 0, 51); // Compiler builtin, should work
|
||||
memccpy((void *)arr2, (void *)arr, 1, 100);
|
||||
memccpy((void *)arr2, (void *)arr, 1, 51);
|
||||
if (arr[50] != 1) {
|
||||
puts("Incorrect memccpy");
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
@@ -48,6 +48,8 @@ int main(void) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// no strnlen_s on glibc
|
||||
#ifndef __GLIBC__
|
||||
dest1_len = strnlen_s(dest1, 6);
|
||||
printf("%d\n", dest1_len);
|
||||
if(dest1_len != 6) {
|
||||
@@ -68,6 +70,7 @@ int main(void) {
|
||||
puts("strnlen_s(NULL, 100) failed");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user