[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/13] trim: use xwalloc rather than xalloc
From: |
Paul Eggert |
Subject: |
[PATCH 12/13] trim: use xwalloc rather than xalloc |
Date: |
Sun, 4 Jun 2017 23:46:02 -0700 |
* lib/trim.c: Include xwalloc.h instead of xalloc.h.
(trim2): Use xwstrdup rather than strdup and xalloc_die.
* modules/trim (Depends-on): Remove xalloc, add xwalloc.
---
ChangeLog | 5 +++++
lib/trim.c | 9 ++-------
modules/trim | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 460a383..4b34cb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2017-06-04 Paul Eggert <address@hidden>
+ trim: use xwalloc rather than xalloc
+ * lib/trim.c: Include xwalloc.h instead of xalloc.h.
+ (trim2): Use xwstrdup rather than strdup and xalloc_die.
+ * modules/trim (Depends-on): Remove xalloc, add xwalloc.
+
quotearg: use xwalloc rather than xalloc
* lib/quotearg.c: Include xwalloc.h instead of xalloc.h.
(clone_quoting_options, quotearg_alloc_mem, nslots)
diff --git a/lib/trim.c b/lib/trim.c
index a4dca9f..e06cba8 100644
--- a/lib/trim.c
+++ b/lib/trim.c
@@ -28,7 +28,7 @@
#include "mbchar.h"
#include "mbiter.h"
-#include "xalloc.h"
+#include "xwalloc.h"
/* Use this to suppress gcc's "...may be used before initialized" warnings. */
#if defined GCC_LINT || defined lint
@@ -40,12 +40,7 @@
char *
trim2 (const char *s, int how)
{
- char *d;
-
- d = strdup (s);
-
- if (!d)
- xalloc_die ();
+ char *d = xwstrdup (s);
if (MB_CUR_MAX > 1)
{
diff --git a/modules/trim b/modules/trim
index c954509..2822a92 100644
--- a/modules/trim
+++ b/modules/trim
@@ -6,7 +6,7 @@ lib/trim.h
lib/trim.c
Depends-on:
-xalloc
+xwalloc
mbchar
mbiter
memmove
--
2.9.4
- [PATCH 06/13] acl-permissions: use walloc, (continued)
- [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, 2017/06/05
- [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 <=