X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fopt%2Fhelpers.c;h=118e543602e06b981e6faee7dd5f416cf819d5cd;hb=cc3db07ecc15f3e1e556387d82318697956e8e0c;hp=f247301cd7a2ba236871f8327c56a79ea144509f;hpb=106eab33eac437bdde11280e5f05f194a8fdb8c8;p=ccan diff --git a/ccan/opt/helpers.c b/ccan/opt/helpers.c index f247301c..118e5436 100644 --- a/ccan/opt/helpers.c +++ b/ccan/opt/helpers.c @@ -14,10 +14,9 @@ /* Upper bound to sprintf this simple type? Each 3 bits < 1 digit. */ #define CHAR_SIZE(type) (((sizeof(type)*CHAR_BIT + 2) / 3) + 1) -/* FIXME: asprintf module? */ static char *arg_bad(const char *fmt, const char *arg) { - char *str = malloc(strlen(fmt) + strlen(arg)); + char *str = opt_alloc.alloc(strlen(fmt) + strlen(arg)); sprintf(str, fmt, arg); return str; }