From: Anatol Belski Date: Fri, 19 Sep 2014 07:09:20 +0000 (+0200) Subject: fix condition X-Git-Tag: POST_NATIVE_TLS_MERGE^2~202 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f25f672916500a209f98ec6b7b342794a065ea7f;p=php fix condition --- diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index cb96c190db..260bb5fd58 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -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';