summaryrefslogtreecommitdiff
path: root/lib/localename.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-01-13 10:50:12 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2023-01-13 12:15:50 -0800
commit9441e9eb30a9483729bc692c97e3a47a350599eb (patch)
tree11a3d3839344b30d3ef1d8b760d323d90b927593 /lib/localename.c
parentcccd508bc6097b03240f21d5ee68b617a02d8155 (diff)
downloadgnulib-9441e9eb30a9483729bc692c97e3a47a350599eb.tar.gz
localename: -Wtautological-pointer-compare
Problem found by xlclang 16.1 on AIX 7.2. * lib/localename.c (duplocale, freelocale): Omit unnecessary comparison of non-null args to NULL.
Diffstat (limited to 'lib/localename.c')
-rw-r--r--lib/localename.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/localename.c b/lib/localename.c
index a0e774ccea..5a178c68fe 100644
--- a/lib/localename.c
+++ b/lib/localename.c
@@ -2967,10 +2967,6 @@ duplocale (locale_t locale)
struct locale_hash_node *node;
locale_t result;
- if (locale == NULL)
- /* Invalid argument. */
- abort ();
-
node = (struct locale_hash_node *) malloc (sizeof (struct locale_hash_node));
if (node == NULL)
/* errno is set to ENOMEM. */
@@ -3056,7 +3052,7 @@ void
freelocale (locale_t locale)
#undef freelocale
{
- if (locale == NULL || locale == LC_GLOBAL_LOCALE)
+ if (locale == LC_GLOBAL_LOCALE)
/* Invalid argument. */
abort ();