[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
- [PATCH 01/13] walloc: new module, Paul Eggert, 2017/06/05
- [PATCH 08/13] getgroups: use walloc, Paul Eggert, 2017/06/05
- [PATCH 06/13] acl-permissions: use walloc, Paul Eggert, 2017/06/05
- [PATCH 09/13] group-member: use walloc, Paul Eggert, 2017/06/05
- [PATCH 10/13] propername: use xwalloc rather than xalloc,
Paul Eggert <=
- [PATCH 07/13] exclude: use xwalloc instead of xalloc, Paul Eggert, 2017/06/05
- [PATCH 13/13] xstriconv: use xwalloc rather than xalloc, Paul Eggert, 2017/06/05
- [PATCH 02/13] xwalloc, xwalloc-die, xwallocator: new modules, Paul Eggert, 2017/06/05
- [PATCH 11/13] quotearg: use xwalloc rather than xalloc, Paul Eggert, 2017/06/05
- [PATCH 04/13] careadlinkat: use walloc, Paul Eggert, 2017/06/05
- [PATCH 05/13] dfa: use xwalloc instead of xalloc, Paul Eggert, 2017/06/05
- [PATCH 03/13] allocator: allow reasons other than size overflow, Paul Eggert, 2017/06/05
- [PATCH 12/13] trim: use xwalloc rather than xalloc, Paul Eggert, 2017/06/05