bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH 10/13] propername: use xwalloc rather than xalloc


From: Paul Eggert
Subject: [PATCH 10/13] propername: use xwalloc rather than xalloc
Date: Sun, 4 Jun 2017 23:46:00 -0700

* lib/propername.c: Include xwalloc.h rather than xalloc.h.
(proper_name, proper_name_utf8): Use xwalloc.h rather than
xalloc.h functions.
* modules/propername (Depends-on): Remove xalloc, add xwalloc.
---
 ChangeLog          |  6 ++++++
 lib/propername.c   | 14 +++++++-------
 modules/propername |  2 +-
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index db3adba..8714e51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2017-06-04  Paul Eggert  <address@hidden>
 
+       propername: use xwalloc rather than xalloc
+       * lib/propername.c: Include xwalloc.h rather than xalloc.h.
+       (proper_name, proper_name_utf8): Use xwalloc.h rather than
+       xalloc.h functions.
+       * modules/propername (Depends-on): Remove xalloc, add xwalloc.
+
        group-member: use walloc
        * lib/group-member.c: Include walloc.h instead of
        xalloc-oversized.
diff --git a/lib/propername.c b/lib/propername.c
index 1e5e28b..1af965d 100644
--- a/lib/propername.c
+++ b/lib/propername.c
@@ -41,7 +41,7 @@
 #include "localcharset.h"
 #include "c-strcase.h"
 #include "xstriconv.h"
-#include "xalloc.h"
+#include "xwalloc.h"
 #include "gettext.h"
 
 
@@ -168,8 +168,8 @@ proper_name (const char *name)
       else
         {
           /* Return "TRANSLATION (NAME)".  */
-          char *result =
-            XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);
+          char *result
+            = xwmalloc (strlen (translation) + 2 + strlen (name) + 1 + 1);
 
           sprintf (result, "%s (%s)", translation, name);
           return result;
@@ -210,8 +210,8 @@ proper_name_utf8 (const char *name_ascii, const char 
*name_utf8)
       {
         char *converted_translit;
 
-        size_t len = strlen (locale_code);
-        char *locale_code_translit = XNMALLOC (len + 10 + 1, char);
+        ptrdiff_t len = strlen (locale_code);
+        char *locale_code_translit = xwmalloc (len + 10 + 1);
         memcpy (locale_code_translit, locale_code, len);
         memcpy (locale_code_translit + len, "//TRANSLIT", 10 + 1);
 
@@ -270,8 +270,8 @@ proper_name_utf8 (const char *name_ascii, const char 
*name_utf8)
       else
         {
           /* Return "TRANSLATION (NAME)".  */
-          char *result =
-            XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);
+          char *result
+            = xwmalloc (strlen (translation) + 2 + strlen (name) + 1 + 1);
 
           sprintf (result, "%s (%s)", translation, name);
 
diff --git a/modules/propername b/modules/propername
index 0cc93bf..c54f9f5 100644
--- a/modules/propername
+++ b/modules/propername
@@ -21,7 +21,7 @@ iconv
 localcharset
 c-strcase
 xstriconv
-xalloc
+xwalloc
 gettext-h
 
 configure.ac:
-- 
2.9.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]