home = find_home_for_username (&str[1], len);
if (home) {
- len = strlen (home) + strlen (rest);
+ len = strlen (home) + strlen (rest) + 1;
str = malloc (len);
if (str == NULL) {
perror ("malloc");
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");