]> granicus.if.org Git - php/commitdiff
MFB: Adjust condition
authorIlia Alshanetsky <iliaa@php.net>
Tue, 10 Feb 2009 16:14:27 +0000 (16:14 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 10 Feb 2009 16:14:27 +0000 (16:14 +0000)
main/fopen_wrappers.c
main/streams/plain_wrapper.c

index 7f0fe74599fd54ebed8f9ca10ea1d1c301962e4f..e1fbaa835b799008dde2291dff509d9ef39aba6c 100644 (file)
@@ -528,7 +528,7 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c
                        *end = '\0';
                        end++;
                }
-               if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) > MAXPATHLEN) {
+               if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) {
                        php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
                }
                if (PG(safe_mode)) {
index 0452d568df4a784192224189966013e9aae215ef..80207312585cba7571f302ba8109547517ccf9fa 100644 (file)
@@ -1324,7 +1324,7 @@ not_relative_path:
                /* getcwd() will return always return [DRIVE_LETTER]:/) on windows. */
                *(cwd+3) = '\0';
        
-               if (snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename) > MAXPATHLEN) {
+               if (snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename) >= MAXPATHLEN) {
                        php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", cwd, filename, MAXPATHLEN);
                }
                
@@ -1387,7 +1387,7 @@ not_relative_path:
                if (*ptr == '\0') {
                        goto stream_skip;
                }
-               if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) > MAXPATHLEN) {
+               if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) {
                        php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
                }