]> granicus.if.org Git - php/commitdiff
Fixed wrong usage of strncmp.
authorStefan Roehrich <sr@php.net>
Thu, 1 Aug 2002 21:12:09 +0000 (21:12 +0000)
committerStefan Roehrich <sr@php.net>
Thu, 1 Aug 2002 21:12:09 +0000 (21:12 +0000)
main/SAPI.c

index 7d984a37dbf1e6d9871fb8e7c115526857226ab8..20559b365050290916352aa1ee920cb4baf08b95 100644 (file)
@@ -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){