mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-08-22 09:16:02 +00:00
tar: more-consistent EOF checking
* src/names.c (read_name_from_file): Test sign of getc return, rather than checking exactly for EOF. This helps the compiler a little bit and is more consistent with other parts of this code.
This commit is contained in:
+2
-2
@@ -975,13 +975,13 @@ read_name_from_file (struct name_elt *ent)
|
||||
}
|
||||
}
|
||||
|
||||
if (counter == 0 && c != EOF)
|
||||
if (counter == 0 && 0 <= c)
|
||||
return file_list_skip;
|
||||
|
||||
if (counter == name_buffer_length)
|
||||
name_buffer = xpalloc (name_buffer, &name_buffer_length, 1, -1, 1);
|
||||
name_buffer[counter] = 0;
|
||||
return (counter == 0 && c == EOF) ? file_list_end : file_list_success;
|
||||
return (counter == 0 && c < 0) ? file_list_end : file_list_success;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
||||
Reference in New Issue
Block a user