diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2009-02-10 16:14:27 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2009-02-10 16:14:27 +0000 |
commit | c752e95c3648e1422ffe53ddb56acc9cdc97299b (patch) | |
tree | 8bce78be19e06223dd52596608411b4b0f05d785 | |
parent | 3b4540f92669f368d78a19f57ad30ee35bfdbba2 (diff) | |
download | php-git-c752e95c3648e1422ffe53ddb56acc9cdc97299b.tar.gz |
MFB: Adjust condition
-rw-r--r-- | main/fopen_wrappers.c | 2 | ||||
-rw-r--r-- | main/streams/plain_wrapper.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 7f0fe74599..e1fbaa835b 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -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)) { diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 0452d568df..8020731258 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -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); } |