X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Ftilde.c;h=83aa70d9a6708656dfcfabb0869a82bfc47cd561;hp=c599e16fc09690ee5dc28a12654040365c4d119d;hb=d8346d5d6428c7293d1ddf58e4f9ec4b7de25380;hpb=c372c7c23a298a940b8a0868396ef2ae0d824e4d diff --git a/fish/tilde.c b/fish/tilde.c index c599e16..83aa70d 100644 --- a/fish/tilde.c +++ b/fish/tilde.c @@ -85,7 +85,7 @@ expand_home (const char *append) home = getenv ("HOME"); if (!home) home = "~"; - len = strlen (home) + (append ? strlen (append) : 0); + len = strlen (home) + (append ? strlen (append) : 0) + 1; str = malloc (len); if (str == NULL) { perror ("malloc");