Subversion Repositories RepoView

Rev

Rev 42 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 42 Rev 44
Line 1... Line 1...
1
/* $Id: multipart.c 42 2024-08-22 05:25:09Z nishi $ */
1
/* $Id: multipart.c 44 2024-08-22 05:52:32Z nishi $ */
2
 
2
 
3
#include "rv_multipart.h"
3
#include "rv_multipart.h"
4
 
4
 
5
#include "rv_util.h"
5
#include "rv_util.h"
6
 
6
 
Line 51... Line 51...
51
				phase = 1;
51
				phase = 1;
52
				fstart = i + 1;
52
				fstart = i + 1;
53
			} else if(strcmp(b, line) == 0 || strcmp(eb, line) == 0) {
53
			} else if(strcmp(b, line) == 0 || strcmp(eb, line) == 0) {
54
				if(phase == 1) {
54
				if(phase == 1) {
55
					unsigned long long fend = i - strlen(line) - 2;
55
					unsigned long long fend = i - strlen(line) - 2;
56
					char* data = buffer + fstart;
56
					char* data = (char*)buffer + fstart;
57
					unsigned long long datalen = fend - fstart;
57
					unsigned long long datalen = fend - fstart;
58
					struct multipart_entry* entry = malloc(sizeof(*entry));
58
					struct multipart_entry* entry = malloc(sizeof(*entry));
59
					entry->length = datalen;
59
					entry->length = datalen;
60
					entry->data = malloc(datalen);
60
					entry->data = malloc(datalen);
61
					entry->name = rv_strdup(name);
61
					entry->name = rv_strdup(name);