cvs: php4 /main SAPI.c
| From: | Stefan Roehrich | Date: | Thu, 01 Aug 2002 21:12:09 +0000 |
| Subject: | cvs: php4 /main SAPI.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13087@lists.php.net to get a copy of this message | ||
sr Thu Aug 1 17:12:09 2002 EDT
Modified files:
/php4/main SAPI.c
Log:
Fixed wrong usage of strncmp.
Index: php4/main/SAPI.c
diff -u php4/main/SAPI.c:1.141 php4/main/SAPI.c:1.142
--- php4/main/SAPI.c:1.141 Thu Aug 1 05:00:30 2002
+++ php4/main/SAPI.c Thu Aug 1 17:12:09 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.c,v 1.141 2002/08/01 09:00:30 helly Exp $ */
+/* $Id: SAPI.c,v 1.142 2002/08/01 21:12:09 sr Exp $ */
#include <ctype.h>
#include <sys/stat.h>
@@ -502,14 +502,14 @@
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){