Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strlen improvement #34

Merged
merged 1 commit into from
Apr 3, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions main/rfc1867.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header T

/* get lines of text, or CRLF_CRLF */

while( (line = get_line(self TSRMLS_CC)) && strlen(line) > 0 )
while( (line = get_line(self TSRMLS_CC)) && line[0] != '\0' )
{
/* add header to table */
char *key = line;
Expand Down Expand Up @@ -979,7 +979,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
continue;
}

if (strlen(filename) == 0) {
if (filename[0] == '\0') {
#if DEBUG_FILE_UPLOAD
sapi_module.sapi_error(E_NOTICE, "No file uploaded");
#endif
Expand Down Expand Up @@ -1063,12 +1063,12 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */

if (!cancel_upload && !end) {
#if DEBUG_FILE_UPLOAD
sapi_module.sapi_error(E_NOTICE, "Missing mime boundary at the end of the data for file %s", strlen(filename) > 0 ? filename : "");
sapi_module.sapi_error(E_NOTICE, "Missing mime boundary at the end of the data for file %s", filename[0] != '\0' ? filename : "");
#endif
cancel_upload = UPLOAD_ERROR_C;
}
#if DEBUG_FILE_UPLOAD
if (strlen(filename) > 0 && total_bytes == 0 && !cancel_upload) {
if (filename[0] != '\0' && total_bytes == 0 && !cancel_upload) {
sapi_module.sapi_error(E_WARNING, "Uploaded file size 0 - file [%s=%s] not saved", param, filename);
cancel_upload = 5;
}
Expand Down