]> pd.if.org Git - pdclib/blobdiff - functions/string/strdup.c
RegTest gives warning about implicitly declared functions. Fixed.
[pdclib] / functions / string / strdup.c
index 6ed0f832feef21b29ec9871c622c6661c75a7b4b..9be484a623eb4e760f7dd7b395b8195191f76ea6 100644 (file)
@@ -4,6 +4,10 @@
    Permission is granted to use, modify, and / or redistribute at will.\r
 */\r
 \r
+#ifdef REGTEST\r
+#define _POSIX_C_SOURCE 200809L\r
+#endif\r
+\r
 #include <string.h>\r
 #include <stdlib.h>\r
 \r
@@ -32,13 +36,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