Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/libarchive/dist/libarchive avoid always passing...



details:   https://anonhg.NetBSD.org/src/rev/21767c20bb0e
branches:  trunk
changeset: 954502:21767c20bb0e
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Sep 05 13:35:24 2020 +0000

description:
avoid always passing NULL to printf()-like functions

diffstat:

 external/bsd/libarchive/dist/libarchive/archive_read_open_filename.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r 64ed7331391b -r 21767c20bb0e external/bsd/libarchive/dist/libarchive/archive_read_open_filename.c
--- a/external/bsd/libarchive/dist/libarchive/archive_read_open_filename.c      Sat Sep 05 13:34:19 2020 +0000
+++ b/external/bsd/libarchive/dist/libarchive/archive_read_open_filename.c      Sat Sep 05 13:35:24 2020 +0000
@@ -221,7 +221,9 @@
        struct read_file_data *mine = (struct read_file_data *)client_data;
        void *buffer;
        const char *filename = NULL;
+#if defined(_WIN32) && !defined(__CYGWIN__)
        const wchar_t *wfilename = NULL;
+#endif
        int fd = -1;
        int is_disk_like = 0;
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
@@ -281,10 +283,12 @@
 #endif
        }
        if (fstat(fd, &st) != 0) {
+#if defined(_WIN32) && !defined(__CYGWIN__)
                if (mine->filename_type == FNT_WCS)
                        archive_set_error(a, errno, "Can't stat '%S'",
                            wfilename);
                else
+#endif
                        archive_set_error(a, errno, "Can't stat '%s'",
                            filename);
                goto fail;



Home | Main Index | Thread Index | Old Index