+/*
+ * 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 libraries 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
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){
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;
/*** 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
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);
int i, j;
int mask_needed;
Boolean SUN;
- char *base_name, *suffix, fname[256], *tmp, *tmp2, *vend;
+ char *base_name, *suffix, fname[MAXPATHLEN], *tmp, *tmp2, *vend;
Pixmap scratch_pix;
XImage *scratch_shape, *scratch_mask;
struct stat statbuf; /* Information on a file. */
netfile = tt_host_file_netfile(fnameIn, tmp+1);
localfile = tt_netfile_file(netfile);
- strncpy(fname, localfile, MAXPATHLEN);
+ strncpy(fname, localfile, MAXPATHLEN - 1);
+ fname[MAXPATHLEN - 1] = 0;
tmp[0] = ':';
tt_free(netfile);
if (debug)
Dump_AttribStruct(&xpm_WriteAttribs);
#endif
- status = _DtXpmWriteFileFromPixmap(dpy, fname, color_icon, NULL,
+ status = _DtXpmWriteFileFromPixmap(dpy, fname, color_icon, 0,
&xpm_WriteAttribs);
/*******
/*** 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);
}
icon_height = height;
fileFormat = FORMAT_XPM;
XmToggleButtonGadgetSetState(formatMenu_xpm_tb, True, True);
-/* This line is not realy needed since an Exposed event will be generated */
+/* This line is not really needed since an Exposed event will be generated */
Repaint_Exposed_Tablet();
XDestroyImage(scratch_img);
XFreePixmap(dpy, pix_ret);
icon_height = height;
fileFormat = FORMAT_XBM;
XmToggleButtonGadgetSetState(formatMenu_xbm_tb, True, True);
-/* This line is not realy needed since an Exposed event will be generated */
+/* This line is not really needed since an Exposed event will be generated */
Repaint_Exposed_Tablet();
if (mask_ret) {
XDestroyImage(test_img);