dticon: Fix some warnings related to mixing NULL, 0 and '\0' randomly.
[oweals/cde.git] / cde / programs / dticon / fileIO.c
index 8206fb941da561129c2fd37eebf6d90adb2ad82d..ca03aa0cc92b00a3c064c629600f591d61d13af9 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
 /* $XConsortium: fileIO.c /main/8 1996/10/21 17:31:11 mgreess $ */
 /*********************************************************************
 *  (c) Copyright 1993, 1994 Hewlett-Packard Company
@@ -110,9 +132,9 @@ Do_FileIO(
   if (debug)
     stat_out("Entering Do_FileIO\n");
 #endif
-  pix_ret = NULL;
-  shape_ret = NULL;
-  mask_ret = NULL;
+  pix_ret = 0;
+  shape_ret = 0;
+  mask_ret = 0;
 
   /* get file name */
   if (SaveMeNot){
@@ -272,9 +294,9 @@ Read_File(
 
   XmUpdateDisplay(mainWindow);
 
-  pix_ret = NULL;
-  shape_ret = NULL;
-  mask_ret = NULL;
+  pix_ret = 0;
+  shape_ret = 0;
+  mask_ret = 0;
   xpm_ReadAttribs.valuemask = READ_FLAGS;
   xpm_ReadAttribs.colorsymbols = colorSymbols;
   xpm_ReadAttribs.numsymbols = NUM_PENS;
@@ -366,7 +388,7 @@ Read_File(
 /*** does a suffix exist? ***/
     if (suffix) {
       strncpy(dummy, fname, ((suffix-fname)-1));
-      dummy[(int) (suffix-fname)-1] = NULL;
+      dummy[(int) (suffix-fname)-1] = '\0';
       strcat(dummy, "_m.");
       strcat(dummy, suffix);
 #ifdef DEBUG
@@ -390,11 +412,11 @@ Read_File(
     if (status == BitmapSuccess) {
       if ((width_ret != mask_width_ret) || (height_ret != mask_height_ret)) {
         XFreePixmap(dpy, mask_ret);
-        mask_ret = NULL;
+        mask_ret = 0;
        }
      }
     else
-      mask_ret = NULL;
+      mask_ret = 0;
    }
 
   strcpy(last_fname, fname);
@@ -495,7 +517,7 @@ Write_File(
   if (debug)
     Dump_AttribStruct(&xpm_WriteAttribs);
 #endif
-    status = _DtXpmWriteFileFromPixmap(dpy, fname, color_icon, NULL,
+    status = _DtXpmWriteFileFromPixmap(dpy, fname, color_icon, 0,
                                 &xpm_WriteAttribs);
 
 /*******
@@ -528,7 +550,7 @@ Write_File(
 /*** THIRD, construct the mask filename ***/
     if (suffix) {
       strncpy(dummy, fname, ((suffix-fname)-1));
-      dummy[(int) (suffix-fname)-1] = NULL;
+      dummy[(int) (suffix-fname)-1] = '\0';
       strcat(dummy, "_m.");
       strcat(dummy, suffix);
     }