memset(pivot, 0, (cp-name + vp-value + 5) * sizeof (char));
strncpy (pivot, name, cp-name);
+ pivot[cp-name] = '\0';
strncat (pivot, ": ", 2);
strncat (pivot, value, vp-value);
strncat (pivot, "\r\n", 2);
void cgiHeader ()
{
if (cgiType)
+ {
printf ("Content-type: %s\r\n", cgiType);
+ free(cgiType);
+ cgiType = NULL;
+ }
else
printf ("Content-type: text/html\r\n");
if (cgiHeaderString)
+ {
printf ("%s", cgiHeaderString);
+ free(cgiHeaderString);
+ cgiHeaderString = NULL;
+ }
printf ("\r\n");
}