diff options
author | Guillem Jover <guillem@debian.org> | 2019-10-02 04:13:19 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2019-10-30 22:02:48 +0100 |
commit | 032da9675c087abab819d0346765b874e8daf685 (patch) | |
tree | 7bf1ae1a4e00c7a38dcccdb29624a4f4ffcd4f12 | |
parent | 8da9c02a82840b6dbcecedfbc8e19264efd4dcbe (diff) | |
download | dpkg-032da9675c087abab819d0346765b874e8daf685.tar.gz |
libdpkg: Use p instead of name in dpkg_arch_name_is_illegal()
We assign name to p, which we operate on everywhere in this function
except for the first check which we still perform on name. This confuses
at least cppcheck, and it's in any case inconsistent.
Warned-by: cppcheck
Fixes: nullPointerRedundantCheck
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | lib/dpkg/arch.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index 07ce962c9..5991d84b8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -57,6 +57,7 @@ dpkg (1.20.0) UNRELEASED; urgency=medium - libdpkg: Add new C locale switch over support. - libdpkg: Add new versiondescribe_c() to force a C locale. - dselect: Make baselist::draw_column_*() col arguments const. + - libdpkg: Use p instead of name in dpkg_arch_name_is_illegal(). * Build system: - Bump minimal Perl version to 5.24.1. - Add a serial versioning to the m4 files. diff --git a/lib/dpkg/arch.c b/lib/dpkg/arch.c index 83c6579f1..96f261704 100644 --- a/lib/dpkg/arch.c +++ b/lib/dpkg/arch.c @@ -58,7 +58,7 @@ dpkg_arch_name_is_illegal(const char *name) static char buf[150]; const char *p = name; - if (name == NULL) + if (p == NULL) internerr("arch name argument is NULL"); if (!*p) return _("may not be empty string"); |