mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-04-28 12:17:07 +00:00
maint: pacify -Wzero-as-null-pointer-constant
Recent Gnulib enables this warning, and it did find a bug in GNU Tar, so pacify GCC everywhere else by preferring NULL to 0 for pointers.
This commit is contained in:
10
src/buffer.c
10
src/buffer.c
@@ -318,8 +318,8 @@ struct zip_program
|
||||
};
|
||||
|
||||
static struct zip_magic const magic[] = {
|
||||
{ ct_none, 0, 0 },
|
||||
{ ct_tar, 0, 0 },
|
||||
{ ct_none, 0, NULL },
|
||||
{ ct_tar, 0, NULL },
|
||||
{ ct_compress, 2, "\037\235" },
|
||||
{ ct_gzip, 2, "\037\213" },
|
||||
{ ct_bzip2, 3, "BZh" },
|
||||
@@ -413,7 +413,7 @@ check_compressed_archive (bool *pshort)
|
||||
sfr = read_full_records;
|
||||
read_full_records = true; /* Suppress fatal error on reading a partial
|
||||
record */
|
||||
*pshort = find_next_block () == 0;
|
||||
*pshort = !find_next_block ();
|
||||
|
||||
/* Restore global values */
|
||||
read_full_records = sfr;
|
||||
@@ -615,12 +615,12 @@ find_next_block (void)
|
||||
if (current_block == record_end)
|
||||
{
|
||||
if (hit_eof)
|
||||
return 0;
|
||||
return NULL;
|
||||
flush_archive ();
|
||||
if (current_block == record_end)
|
||||
{
|
||||
hit_eof = true;
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return current_block;
|
||||
|
||||
Reference in New Issue
Block a user