From: Rusty Russell Date: Mon, 30 Aug 2010 03:14:15 +0000 (+0930) Subject: ccanlint: fix abort on "-d ..". X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=0939b69164c65329fa8f6b2c4ab5e9c7d9162678 ccanlint: fix abort on "-d ..". --- diff --git a/tools/tools.c b/tools/tools.c index b7beda72..2983cfca 100644 --- a/tools/tools.c +++ b/tools/tools.c @@ -28,7 +28,7 @@ char *talloc_basename(const void *ctx, const char *dir) char *p = strrchr(dir, '/'); if (!p) - return (char *)dir; + return talloc_strdup(ctx, dir); return talloc_strdup(ctx, p+1); }