]> pd.if.org Git - pdclib/blobdiff - functions/string/strdup.c
Type mismatches give compiler warnings. Fixed.
[pdclib] / functions / string / strdup.c
index ac2200e599080243ef9e33d51bb8328e274999d1..d8792f30b72a98af858720b3c9a7c93a89630226 100644 (file)
@@ -9,7 +9,6 @@
 \r
 #ifndef REGTEST\r
 \r
-#pragma weak strdup\r
 char *strdup(const char *s)\r
 {\r
     char* ns = NULL;\r
@@ -33,13 +32,13 @@ int main( void )
     const char *teststr2 = "An alternative test string with non-7-bit characters \xFE\x8C\n";\r
     char *testres, *testres2;\r
 \r
-    TESTCASE(testres  = strdup(teststr));\r
-    TESTCASE(testres2 = strdup(teststr2));\r
+    TESTCASE((testres  = strdup(teststr)) != NULL);\r
+    TESTCASE((testres2 = strdup(teststr2)) != NULL);\r
     TESTCASE(strcmp(testres, teststr) == 0);\r
     TESTCASE(strcmp(testres2, teststr2) == 0);\r
     free(testres);\r
     free(testres2);\r
-    \r
+\r
     return TEST_RESULTS;\r
 }\r
 \r