From f871a5b742909e8dbb09a6a9a0c826b95abb6353 Mon Sep 17 00:00:00 2001 From: Stefan Roehrich Date: Thu, 1 Aug 2002 21:12:09 +0000 Subject: [PATCH] Fixed wrong usage of strncmp. --- main/SAPI.c | 8 ++++---- 1 file 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){ -- 2.50.1