]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
make the contents able to be any data, the previous stopped at white space
authorDaniel Stenberg <daniel@haxx.se>
Fri, 30 Apr 2004 06:45:53 +0000 (06:45 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 30 Apr 2004 06:45:53 +0000 (06:45 +0000)
src/main.c

index 78702e50fd76f077b9cc46e3389de89861743a68..db6034bc540cc1bebc83f9aff623400c55737913 100644 (file)
@@ -762,13 +762,12 @@ static int formparse(char *input,
   char *sep;
   char *sep2;
 
-  /* Preallocate contents to the length of input to make sure we don't
-     overwrite anything. */
-  contents = malloc(strlen(input));
-  contents[0] = '\000';
-  if(1 <= sscanf(input, "%255[^=]=%s", name, contents)) {
+  if((1 == sscanf(input, "%255[^=]=", name)) &&
+     (contp = strchr(input, '='))) {
     /* the input was using the correct format */
+    
+    /* Allocate the contents */
+    contents = strdup(contp+1);
     contp = contents;
 
     if('@' == contp[0]) {