Update draft release notes for 1.5.4
[gitweb.git] / builtin-pack-objects.c
index e0ce114be7f65307da96bc620d5fb8902b793c73..a39cb82c9beb5c44f59c459bfc6ac384b42b6b3c 100644 (file)
@@ -2013,7 +2013,7 @@ static void get_object_list(int ac, const char **av)
 
        while (fgets(line, sizeof(line), stdin) != NULL) {
                int len = strlen(line);
-               if (line[len - 1] == '\n')
+               if (len && line[len - 1] == '\n')
                        line[--len] = 0;
                if (!len)
                        break;