dtcm: Resolve CID 87713
[oweals/cde.git] / cde / programs / dtcm / server / cmsfunc.c
index 4e67646092bdeeb6a2d6b7f2f9ea8365b2401eaf..618d15a78f0feceb3d8241cfa1c8ea23802f6d8c 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: cmsfunc.c /main/4 1995/11/09 12:42:12 rswiston $ */
 /*
  *  (c) Copyright 1993, 1994 Hewlett-Packard Company
@@ -65,12 +87,10 @@ static CSA_return_code _DtCmsGetOldCalAttrNames(_DtCmsCalendar *cal,
 extern void *
 cms_ping_5_svc(void *args, struct svc_req *svcrq)
 {
-       char dummy;
-
        if (debug)
                fprintf(stderr, "cms_ping_5_svc called\n");
 
-       return((void *)&dummy); /* for RPC reply */
+       return(NULL); /* for RPC reply */
 }
 
 
@@ -1219,7 +1239,7 @@ _DtCmsCreateCallog(char *user, cms_create_args *args, _DtCmsCalendar **newcal)
 
        /* use passed in char set if client does not supply one */
        if (cal->attrs[CSA_CAL_ATTR_CHARACTER_SET_I].value == NULL &&
-            args->char_set && *args->char_set != NULL) {
+            args->char_set && *args->char_set != '\0') {
                if ((stat = _DtCm_set_string_attrval(args->char_set,
                    &cal->attrs[CSA_CAL_ATTR_CHARACTER_SET_I].value,
                    CSA_VALUE_STRING)) != CSA_SUCCESS) {
@@ -1315,7 +1335,7 @@ _grow_char_array(void *ptr, uint oldcount, uint newcount)
        void *nptr;
 
        if (nptr = realloc(ptr, newcount)) {
-               memset((void *)((char *)nptr + oldcount), NULL,
+               memset((void *)((char *)nptr + oldcount), 0,
                        newcount - oldcount);
                return (nptr);
        } else