dtcm: Resolve CID 87562
[oweals/cde.git] / cde / programs / dtcm / dtcm / dnd.c
index e62fae24d1f15b4b078e0734f05f34a427a814a0..eeab0afe582e2f189867dca5b60107d840610978 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
+ */
 /* $TOG: dnd.c /main/12 1998/04/09 11:43:47 mgreess $ */
 /*
  *  (c) Copyright 1993, 1994 Hewlett-Packard Company
@@ -50,7 +72,7 @@
 
 static Bool lookForButton(Display *, XEvent *, XPointer);
 
-#if !defined(linux)
+#if !defined(linux) && !defined(CSRG_BASED)
 extern char    *sys_errlist[];
 #endif
 
@@ -156,7 +178,7 @@ handle_animate_cb(
                        drag_load_proc(dnd_filename, c);
        
                        unlink(dnd_filename);
-                       dnd_filename[0] = NULL;
+                       dnd_filename[0] = '\0';
                        break;
                default:
                        return;
@@ -235,7 +257,7 @@ handle_drop_cb(
        
                        if (validate_dropped_appt(dnd_filename, c) == False) {
                                unlink(dnd_filename);
-                               dnd_filename[0] = NULL
+                               dnd_filename[0] = '\0'
                                transfer_info->status = DtDND_FAILURE;
                        }
 #ifdef NOT
@@ -525,7 +547,7 @@ get_appt_struct(DragContext *context) {
                XtFree(ident);
                XtFree(text);
                XtFree(title);
-                return(NULL);
+                return(0);
         }
  
 
@@ -555,7 +577,7 @@ get_appt_struct(DragContext *context) {
                XtFree(ident);
                XtFree(title);
                 XtFree((XtPointer)item_list);
-                return(NULL);
+                return(0);
         }
 
        return entry;
@@ -608,24 +630,24 @@ GetIcon(Calendar *calendar)
         Editor          *e = (Editor *) calendar->editor;
         GEditor         *ge = (GEditor *) calendar->geditor;
  
-        if (e->drag_bitmap == NULL) {
+        if (e->drag_bitmap == 0) {
                 e->drag_bitmap = XCreateBitmapFromData(display,
                         window, (char *) drag_xbm_bits,
                         drag_xbm_width, drag_xbm_height);
-                if (e->drag_bitmap == NULL) {
+                if (e->drag_bitmap == 0) {
 
-                        printf(catgets(calendar->DT_catd, 1, 237, "XCreateBitmapFromData() failed for bitmap.\n"));
+                        printf("%s", catgets(calendar->DT_catd, 1, 237, "XCreateBitmapFromData() failed for bitmap.\n"));
                         return;
                 }
                 else
                         ge->drag_bitmap = e->drag_bitmap;
         }
-        if (e->drag_mask == NULL) {
+        if (e->drag_mask == 0) {
                 e->drag_mask = XCreateBitmapFromData(display,
                         window, (char *) drag_mask_xbm_bits,
                         drag_mask_xbm_width, drag_mask_xbm_height);
-                if (e->drag_mask == NULL) {
-                        printf(catgets(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n"));
+                if (e->drag_mask == 0) {
+                        printf("%s", catgets(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n"));
                         return;
                 }
                 else
@@ -776,7 +798,7 @@ TranslationDragStart(
                             DtNsourceIcon, e->drag_icon,
                             NULL) == NULL) {
  
-                printf(catgets(calendar->DT_catd, 1, 239, 
+                printf("%s", catgets(calendar->DT_catd, 1, 239, 
                                        "DragStart returned NULL.\n"));
         }
 }
@@ -926,7 +948,7 @@ ApptDragStart(
                NULL)
             == NULL) {
  
-                printf(catgets(calendar->DT_catd, 1, 239,
+                printf("%s", catgets(calendar->DT_catd, 1, 239,
                               "DragStart returned NULL.\n"));
         }
 }