about summary refs log tree commit diff
path: root/lib/libppmcolor.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libppmcolor.c')
-rw-r--r--lib/libppmcolor.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/libppmcolor.c b/lib/libppmcolor.c
index 27340d5f..7079482c 100644
--- a/lib/libppmcolor.c
+++ b/lib/libppmcolor.c
@@ -9,10 +9,6 @@
 ** implied warranty.
 */
 
-#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
-#define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
-#define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
-
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
@@ -194,9 +190,9 @@ processColorfileEntry(struct colorfile_entry const ce,
             *errorP = NULL;
         } else {
             ppm_addtocolorhash(cht, &color, *colornameIndexP);
-            colornames[*colornameIndexP] = strdup(ce.colorname);
+            colornames[*colornameIndexP] = pm_strdup(ce.colorname);
             colors[*colornameIndexP] = color;
-            if (colornames[*colornameIndexP] == NULL)
+            if (colornames[*colornameIndexP] == pm_strsol)
                 pm_asprintf(errorP, "Unable to allocate space for color name");
             else {
                 *errorP = NULL;