X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=string.c;h=bb82adcbb5e310e539226436d9649ca4a6964f0b;hb=66cdd5bc99a53d2b408a6cdc2d501fe27f9db13b;hp=afac0027fce2e8b4f63a35007a33b0d3e74bc7ce;hpb=defca4768aa9b02fca97b63159dd261e4871a3ce;p=dss.git diff --git a/string.c b/string.c index afac002..bb82adc 100644 --- a/string.c +++ b/string.c @@ -1,5 +1,11 @@ +/* + * Copyright (C) 2004-2010 Andre Noll + * + * Licensed under the GPL v2. For licencing details see COPYING. + */ #include #include +#include #include #include #include @@ -9,7 +15,6 @@ #include -#include "cmdline.h" #include "gcc-compat.h" #include "log.h" #include "error.h" @@ -67,8 +72,8 @@ __must_check __malloc void *dss_realloc(void *p, size_t size) */ assert(size); if (!(p = realloc(p, size))) { - DSS_EMERG_LOG("realloc failed (size = %zu), aborting\n", - size); + DSS_EMERG_LOG(("realloc failed (size = %zu), aborting\n", + size)); exit(EXIT_FAILURE); } return p; @@ -88,12 +93,13 @@ __must_check __malloc void *dss_realloc(void *p, size_t size) */ __must_check __malloc void *dss_malloc(size_t size) { + void *p; assert(size); - void *p = malloc(size); + p = malloc(size); if (!p) { - DSS_EMERG_LOG("malloc failed (size = %zu), aborting\n", - size); + DSS_EMERG_LOG(("malloc failed (size = %zu), aborting\n", + size)); exit(EXIT_FAILURE); } return p; @@ -139,7 +145,7 @@ __must_check __malloc char *dss_strdup(const char *s) if ((ret = strdup(s? s: ""))) return ret; - DSS_EMERG_LOG("strdup failed, aborting\n"); + DSS_EMERG_LOG(("strdup failed, aborting\n")); exit(EXIT_FAILURE); } @@ -234,7 +240,7 @@ __must_check __malloc char *dss_logname(void) * * \return The number of substrings found in \a args. */ -__must_check unsigned split_args(char *args, char *** const argv_ptr, const char *delim) +unsigned split_args(char *args, char *** const argv_ptr, const char *delim) { char *p = args; char **argv;