summaryrefslogtreecommitdiff
path: root/ext/standard/ftp_fopen_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/ftp_fopen_wrapper.c')
-rw-r--r--ext/standard/ftp_fopen_wrapper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index cb96c190db..2bf4e02a41 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -636,7 +636,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
/* Trim off trailing whitespace characters */
tmp_len--;
- while (tmp_len >= 0 &&
+ while (tmp_len > 0 &&
(ent->d_name[tmp_len] == '\n' || ent->d_name[tmp_len] == '\r' ||
ent->d_name[tmp_len] == '\t' || ent->d_name[tmp_len] == ' ')) {
ent->d_name[tmp_len--] = '\0';