summaryrefslogtreecommitdiff
path: root/skill.c
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2011-10-09 21:29:26 +0200
committerSami Kerola <kerolasa@iki.fi>2011-12-20 17:30:50 +0100
commit1ef14f4bf9de937ea97086c8f473d5d08c89a00c (patch)
treeacd5cba53f6eb9358cac46bf89d678374b3c8191 /skill.c
parent4bd36d1483236f257011082e1824f522df89cd3c (diff)
downloadprocps-ng-1ef14f4bf9de937ea97086c8f473d5d08c89a00c.tar.gz
includes: add xalloc.h to unify memory allocations
The xalloc.h provides necessary error checking. Signed-off-by: Jim Warner <james.warner@comcast.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'skill.c')
-rw-r--r--skill.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/skill.c b/skill.c
index 2b9c9f6..4fe9140 100644
--- a/skill.c
+++ b/skill.c
@@ -24,6 +24,7 @@
#include "c.h"
#include "nls.h"
+#include "xalloc.h"
#include "proc/pwcache.h"
#include "proc/sig.h"
#include "proc/devname.h"
@@ -39,8 +40,7 @@ static const char **cmds;
static int *pids;
#define ENLIST(thing,addme) do{ \
-if(!thing##s) thing##s = malloc(sizeof(*thing##s)*saved_argc); \
-if(!thing##s) fprintf(stderr,_("No memory.\n")),exit(2); \
+if(!thing##s) thing##s = xmalloc(sizeof(*thing##s)*saved_argc); \
thing##s[thing##_count++] = addme; \
}while(0)