]> git.ozlabs.org Git - ccan/commitdiff
ccanlint: fix abort on "-d ..".
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 30 Aug 2010 03:14:15 +0000 (12:44 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 30 Aug 2010 03:14:15 +0000 (12:44 +0930)
tools/tools.c

index b7beda72b9c5b6cf0a5ec8beffb34d535887b6a3..2983cfca663bc730130899ae96cb16a75e62baa2 100644 (file)
@@ -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);
 }