diff options
author | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-04 23:20:09 (EST) |
---|---|---|
committer | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-04 23:20:09 (EST) |
commit | 480538737a8a9be074a1848f2e52cf2d1ff4709f (patch) | |
tree | e24d32dc46e0b83600aaa02a33ecaa6779765d9b /libopkg/xregex.c | |
parent | acd905996191df6ab59050bd179a5ed11e6f72a4 (diff) |
s/malloc/xmalloc/ s/calloc/xcalloc/ s/realloc/realloc/
And redundant error checking removed from the places where allocation failures
were actually checked.
git-svn-id: http://opkg.googlecode.com/svn/trunk@259 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/xregex.c')
-rw-r--r-- | libopkg/xregex.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libopkg/xregex.c b/libopkg/xregex.c index b0cd8b9..ba22b7d 100644 --- a/libopkg/xregex.c +++ b/libopkg/xregex.c @@ -18,6 +18,7 @@ #include "includes.h" #include "xregex.h" +#include "libbb/libbb.h" static void print_regcomp_err(const regex_t *preg, int err); @@ -39,10 +40,8 @@ static void print_regcomp_err(const regex_t *preg, int err) fprintf(stderr, "%s: Error compiling regex:", __FUNCTION__); size = regerror(err, preg, 0, 0); - error = calloc(1, size); - if (error) { - regerror(err, preg, error, size); - fprintf(stderr, "%s\n", error); - } + error = xcalloc(1, size); + regerror(err, preg, error, size); + fprintf(stderr, "%s\n", error); free(error); } |