Skip to content

Commit 52bd403

Browse files
committed
fix datatype mismatches
1 parent 37634c9 commit 52bd403

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

main/rfc1867.c

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static int fill_buffer(multipart_buffer *self TSRMLS_DC)
261261

262262
char *buf = self->buffer + self->bytes_in_buffer;
263263

264-
actual_read = sapi_module.read_post(buf, bytes_to_read TSRMLS_CC);
264+
actual_read = (int)sapi_module.read_post(buf, bytes_to_read TSRMLS_CC);
265265

266266
/* update the buffer length */
267267
if (actual_read > 0) {
@@ -300,7 +300,7 @@ static multipart_buffer *multipart_buffer_new(char *boundary, int boundary_len T
300300

301301
spprintf(&self->boundary, 0, "--%s", boundary);
302302

303-
self->boundary_next_len = spprintf(&self->boundary_next, 0, "\n--%s", boundary);
303+
self->boundary_next_len = (int)spprintf(&self->boundary_next, 0, "\n--%s", boundary);
304304

305305
self->buf_begin = self->buffer;
306306
self->bytes_in_buffer = 0;
@@ -442,8 +442,8 @@ static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header T
442442

443443
} else if (zend_llist_count(header)) { /* If no ':' on the line, add to previous line */
444444

445-
prev_len = strlen(prev_entry.value);
446-
cur_len = strlen(line);
445+
prev_len = (int)strlen(prev_entry.value);
446+
cur_len = (int)strlen(line);
447447

448448
entry.value = emalloc(prev_len + cur_len + 1);
449449
memcpy(entry.value, prev_entry.value, prev_len);
@@ -551,7 +551,7 @@ static char *php_ap_getword_conf(const zend_encoding *encoding, char *str TSRMLS
551551
char quote = *str;
552552

553553
str++;
554-
return substring_conf(str, strlen(str), quote);
554+
return substring_conf(str, (int)strlen(str), quote);
555555
} else {
556556
char *strend = str;
557557

@@ -646,11 +646,11 @@ static int multipart_buffer_read(multipart_buffer *self, char *buf, size_t bytes
646646
}
647647

648648
/* update the buffer */
649-
self->bytes_in_buffer -= len;
649+
self->bytes_in_buffer -= (int)len;
650650
self->buf_begin += len;
651651
}
652652

653-
return len;
653+
return (int)len;
654654
}
655655

656656
/*
@@ -721,7 +721,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
721721
/* Get the boundary */
722722
boundary = strstr(content_type_dup, "boundary");
723723
if (!boundary) {
724-
int content_type_len = strlen(content_type_dup);
724+
int content_type_len = (int)strlen(content_type_dup);
725725
char *content_type_lcase = estrndup(content_type_dup, content_type_len);
726726

727727
php_strtolower(content_type_lcase, content_type_len);
@@ -738,7 +738,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
738738
}
739739

740740
boundary++;
741-
boundary_len = strlen(boundary);
741+
boundary_len = (int)strlen(boundary);
742742

743743
if (boundary[0] == '"') {
744744
boundary++;
@@ -1045,7 +1045,11 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
10451045
#endif
10461046
cancel_upload = UPLOAD_ERROR_B;
10471047
} else if (blen > 0) {
1048+
#ifdef PHP_WIN32
1049+
wlen = write(fd, buff, (unsigned int)blen);
1050+
#else
10481051
wlen = write(fd, buff, blen);
1052+
#endif
10491053

10501054
if (wlen == -1) {
10511055
/* write failed */
@@ -1113,7 +1117,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
11131117
is_arr_upload = (start_arr = strchr(param,'[')) && (param[strlen(param)-1] == ']');
11141118

11151119
if (is_arr_upload) {
1116-
array_len = strlen(start_arr);
1120+
array_len = (int)strlen(start_arr);
11171121
if (array_index) {
11181122
efree(array_index);
11191123
}
@@ -1122,7 +1126,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
11221126

11231127
/* Add $foo_name */
11241128
if (llen < strlen(param) + MAX_SIZE_OF_INDEX + 1) {
1125-
llen = strlen(param);
1129+
llen = (int)strlen(param);
11261130
lbuf = (char *) safe_erealloc(lbuf, llen, 1, MAX_SIZE_OF_INDEX + 1);
11271131
llen += MAX_SIZE_OF_INDEX + 1;
11281132
}

0 commit comments

Comments
 (0)