aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-04-30 06:45:53 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-04-30 06:45:53 +0000
commit19f5aa165ca0b931cc7c946ce652f557cccc32a5 (patch)
tree5cfc16fd6f897c7c38a6b32bf5e5c6ec5739b527
parent1756499b11cdd3bad84df074a7aed0f07db09638 (diff)
make the contents able to be any data, the previous stopped at white space
-rw-r--r--src/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 78702e50f..db6034bc5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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]) {