* Switched from bzero() to memset(), thanks Shaleh debian_cgilib_0-4-3
authorJoey Schulze <joey@infodrom.org>
Fri, 11 Sep 1998 19:38:27 +0000 (19:38 +0000)
committerJoey Schulze <joey@infodrom.org>
Fri, 11 Sep 1998 19:38:27 +0000 (19:38 +0000)
  * Corrected typo in cgiInit(3), thanks Shaleh

cgi.c
cgiInit.3

diff --git a/cgi.c b/cgi.c
index 3565a6a..92e4bfa 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -65,7 +65,7 @@ char *cgiDecodeString (char *text)
            *(xp++) = *cp;
        }
     }
-    bzero(xp, cp-xp);
+    memset(xp, 0, cp-xp);
     return text;
 }
 
@@ -112,7 +112,7 @@ s_cgi **cgiInit ()
                length += strlen(tmp);
                if ((ip = (char *)malloc (length * sizeof(char))) == NULL)
                    return NULL;
-               bzero(ip, length);
+               memset(ip, 0, length);
                if (line) {
                    if (line[strlen(line)-1] == '\n')
                        line[strlen(line)-1] = '&';
@@ -158,7 +158,7 @@ s_cgi **cgiInit ()
 
     if ((result = (s_cgi **)malloc((numargs+1) * sizeof(s_cgi *))) == NULL)
        return NULL;
-    bzero (result, (numargs+1) * sizeof(s_cgi *));
+    memset (result, 0, (numargs+1) * sizeof(s_cgi *));
 
     cp = line;
     i=0;
@@ -187,12 +187,12 @@ s_cgi **cgiInit ()
                    return NULL;
                if ((result[i]->name = (char *)malloc((esp-cp+1) * sizeof(char))) == NULL)
                    return NULL;
-               bzero (result[i]->name, esp-cp+1);
+               memset (result[i]->name, 0, esp-cp+1);
                strncpy(result[i]->name, cp, esp-cp);
                cp = ++esp;
                if ((result[i]->value = (char *)malloc((ip-esp+1) * sizeof(char))) == NULL)
                    return NULL;
-               bzero (result[i]->value, ip-esp+1);
+               memset (result[i]->value, 0, ip-esp+1);
                strncpy(result[i]->value, cp, ip-esp);
                result[i]->value = cgiDecodeString(result[i]->value);
                if (cgiDebugLevel) {
@@ -205,7 +205,7 @@ s_cgi **cgiInit ()
            } else {    /* There is already such a name, suppose a mutiple field */
                if ((sptr = (char *)malloc((strlen(result[k]->value)+(ip-esp)+2)* sizeof(char))) == NULL)
                    return NULL;
-               bzero (sptr, strlen(result[k]->value)+(ip-esp)+2);
+               memset (sptr, 0, strlen(result[k]->value)+(ip-esp)+2);
                sprintf (sptr, "%s\n", result[k]->value);
                cp = ++esp;
                strncat(sptr, cp, ip-esp);
index 528d7a7..9f2a73a 100644 (file)
--- a/cgiInit.3
+++ b/cgiInit.3
@@ -28,7 +28,7 @@ cgiInit \- Initializes cgi library
 This routine initializes the cgi routines.  Mainly it reads in and
 decodes cgi data for later processing.  If the program is not called
 via cgi interface the user is prompted to type in cgi variable
-bindings via stdin - just like GGI.pm does.
+bindings via stdin - just like CGI.pm does.
 
 This routine normally is the first or second.  Only
 .BR cgiDebug ()