X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ftilde.c;h=83aa70d9a6708656dfcfabb0869a82bfc47cd561;hb=01d613ae957431d65c700a34e369ef4c06dd6d8f;hp=c599e16fc09690ee5dc28a12654040365c4d119d;hpb=c372c7c23a298a940b8a0868396ef2ae0d824e4d;p=libguestfs.git 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");