summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2009-02-10 16:14:18 +0000
committerIlia Alshanetsky <iliaa@php.net>2009-02-10 16:14:18 +0000
commitaaa5361c9059cba576dfe6fb84fe7adeeee36cf0 (patch)
tree1d2f3d5bc746cfecfebd5807f4a6d706e08203de /main
parent2b531b5149b46444f997db3a1b132b13d0596d53 (diff)
downloadphp-git-aaa5361c9059cba576dfe6fb84fe7adeeee36cf0.tar.gz
Adjust condition
Diffstat (limited to 'main')
-rw-r--r--main/fopen_wrappers.c2
-rw-r--r--main/streams/plain_wrapper.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 2ffce25b9e..5c941b2ee2 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -706,7 +706,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 2b46d506d1..8a7d3c2fc9 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -1328,7 +1328,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);
}
@@ -1391,7 +1391,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);
}