X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Ftilde.c;h=c599e16fc09690ee5dc28a12654040365c4d119d;hp=4085417817d3b9ba14698d13134d6e24663d42d9;hb=5b77be72bc4e46c7a53a24f1eb4cbd107a708f17;hpb=05fd2a60466cb7c270b60e9b93c46548acf319cd diff --git a/fish/tilde.c b/fish/tilde.c index 4085417..c599e16 100644 --- a/fish/tilde.c +++ b/fish/tilde.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -63,7 +62,7 @@ try_tilde_expansion (char *str) str = malloc (len); if (str == NULL) { perror ("malloc"); - exit (1); + exit (EXIT_FAILURE); } strcpy (str, home); strcat (str, rest); @@ -90,7 +89,7 @@ expand_home (const char *append) str = malloc (len); if (str == NULL) { perror ("malloc"); - exit (1); + exit (EXIT_FAILURE); } strcpy (str, home); @@ -111,7 +110,7 @@ find_home_for_username (const char *username, size_t ulen) setpwent (); while ((pw = getpwent ()) != NULL) { if (strlen (pw->pw_name) == ulen && - strncmp (username, pw->pw_name, ulen) == 0) + STREQLEN (username, pw->pw_name, ulen)) return pw->pw_dir; }