Spelling fixes
[oweals/cde.git] / cde / lib / DtSvc / DtEncap / spc-util.c
index 0e25c1872f650b80cf99a29504e3eabfb665add2..0b101631261bcecf8ce442d5843abfe392a63587 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 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
@@ -29,12 +51,12 @@ Wire *get_new_wire(void)
   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);
@@ -74,6 +96,7 @@ SPC_Channel_Ptr SPC_Find_PID(int pid)
  */
 
 /*----------------------------------------------------------------------+*/
+int
 spc_close(int fd)
 /*----------------------------------------------------------------------+*/
 {
@@ -86,13 +109,14 @@ 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);
@@ -112,6 +136,7 @@ spc_dup2(int from, int to)
 }
 
 /*----------------------------------------------------------------------+*/
+int
 SPC_fd_to_connector(SPC_Channel_Ptr channel,
                    int fd)
 /*----------------------------------------------------------------------+*/
@@ -133,7 +158,7 @@ XeString *Alloc_Argv(int n)
   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);
 }
@@ -217,7 +242,7 @@ Boolean _path_search (XeString path, XeString filename, path_search_predicate p)
   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);
@@ -230,9 +255,9 @@ Boolean _path_search (XeString path, XeString filename, path_search_predicate p)
     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
@@ -241,7 +266,7 @@ Boolean _path_search (XeString path, XeString filename, path_search_predicate p)
     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 "."
@@ -259,7 +284,7 @@ Boolean _path_search (XeString path, XeString filename, path_search_predicate p)
 
     if(!buffer[0]) {
       buffer[0] = '.';
-      buffer[1] = NULL;
+      buffer[1] = '\0';
     }
     
     /*