diff options
author | Stefan Roehrich <sr@php.net> | 2002-08-01 21:12:09 +0000 |
---|---|---|
committer | Stefan Roehrich <sr@php.net> | 2002-08-01 21:12:09 +0000 |
commit | f871a5b742909e8dbb09a6a9a0c826b95abb6353 (patch) | |
tree | 1114020cb8f379a0c9cd151889f4d9cd1e33ca1a | |
parent | 9b0553c390cb052c0518eaf81cc5149e261dd171 (diff) | |
download | php-git-f871a5b742909e8dbb09a6a9a0c826b95abb6353.tar.gz |
Fixed wrong usage of strncmp.
-rw-r--r-- | main/SAPI.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/main/SAPI.c b/main/SAPI.c index 7d984a37db..20559b3650 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -502,14 +502,14 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) if (!STRCASECMP(header_line, "Content-Type")) { char *ptr = colon_offset+1, *mimetype = NULL, *newheader; size_t len = header_line_len - (ptr - header_line), newlen; + while (*ptr == ' ' && *ptr != '\0') { + ptr++; + } #if HAVE_ZLIB - if(strncmp(ptr, "image/", sizeof("image/"))) { + if(!strncmp(ptr, "image/", sizeof("image/")-1)) { ZLIBG(output_compression) = 0; } #endif - while (*ptr == ' ' && *ptr != '\0') { - ptr++; - } mimetype = estrdup(ptr); newlen = sapi_apply_default_charset(&mimetype, len TSRMLS_CC); if (!SG(sapi_headers).mimetype){ |