]> granicus.if.org Git - php/commitdiff
fix condition
authorAnatol Belski <ab@php.net>
Fri, 19 Sep 2014 07:09:20 +0000 (09:09 +0200)
committerAnatol Belski <ab@php.net>
Fri, 19 Sep 2014 07:09:20 +0000 (09:09 +0200)
ext/standard/ftp_fopen_wrapper.c

index cb96c190dbae6298bc479ed2e3b6981db53521b0..260bb5fd582964cd8c251fc95a30b50f1296b7df 100644 (file)
@@ -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';