+/*
+ * 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
+ */
/*
* File: spc-util.c $XConsortium: spc-util.c /main/5 1996/06/21 17:33:16 ageorge $
* Language: C
Wire *tmp_wire;
tmp_wire=(Wire *)XeMalloc(sizeof(Wire));
- memset(tmp_wire, NULL, sizeof(Wire));
+ memset(tmp_wire, 0, sizeof(Wire));
tmp_wire->master_name=(XeString)XeMalloc(PTY_NAMLEN);
- memset(tmp_wire->master_name, NULL, PTY_NAMLEN);
+ memset(tmp_wire->master_name, 0, PTY_NAMLEN);
tmp_wire->slave_name =(XeString)XeMalloc(PTY_NAMLEN);
- memset(tmp_wire->slave_name, NULL, PTY_NAMLEN);
+ memset(tmp_wire->slave_name, 0, PTY_NAMLEN);
tmp_wire->fd[0] = tmp_wire->fd[1] = (-1);
tmp_wire->read_toolkit_id = (-1);
tmp_wire->except_toolkit_id = (-1);
*/
/*----------------------------------------------------------------------+*/
+int
spc_close(int fd)
/*----------------------------------------------------------------------+*/
{
}
/*----------------------------------------------------------------------+*/
+int
spc_dup2(int from, int to)
/*----------------------------------------------------------------------+*/
{
int retval;
/* Dup file descriptors. If a null descriptor, then use /dev/null */
- static int devnull = NULL;
+ static int devnull = 0;
if (from == to)
return(TRUE);
}
/*----------------------------------------------------------------------+*/
+int
SPC_fd_to_connector(SPC_Channel_Ptr channel,
int fd)
/*----------------------------------------------------------------------+*/
av = (XeString *)XeMalloc((n + 1) * sizeof(XeString));
/* Zero the space so we don't have to worry about trailing NULL */
- memset((XeString) av, NULL, (n + 1) * sizeof(XeString));
+ memset((XeString) av, 0, (n + 1) * sizeof(XeString));
return(av);
}
XeChar path_component[MAXPATHLEN+1];
int path_component_len;
int filename_len;
- int component_seperator=(int)':'; /* this is here because strchr takes an in */
+ int component_separator=(int)':'; /* this is here because strchr takes an in */
if(!filename)
return(FALSE);
path=getenv("PATH");
for( (path_rest=path ,
- next_colon=strchr(path_rest, component_seperator));
+ next_colon=strchr(path_rest, component_separator));
path_rest && *path_rest;
- next_colon=strchr(path_rest, component_seperator)) {
+ next_colon=strchr(path_rest, component_separator)) {
/*
** Copy path component into buffer
if(next_colon) { /* found colon */
path_component_len = next_colon-path_rest;
strncpy(buffer, path_rest, path_component_len);
- buffer[path_component_len]=NULL;
+ buffer[path_component_len]='\0';
path_rest=next_colon+1;
if(!*path_rest)
/* We've seen a ':' at the end of the string. Make path_rest be "."
if(!buffer[0]) {
buffer[0] = '.';
- buffer[1] = NULL;
+ buffer[1] = '\0';
}
/*