X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Ftilde.c;h=c599e16fc09690ee5dc28a12654040365c4d119d;hp=1c52d3ed2e873cc098e52dd2f061896295dff258;hb=c372c7c23a298a940b8a0868396ef2ae0d824e4d;hpb=6a14f1c2502f58ff7bed8cb451f95a83f5ee920a diff --git a/fish/tilde.c b/fish/tilde.c index 1c52d3e..c599e16 100644 --- a/fish/tilde.c +++ b/fish/tilde.c @@ -62,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); @@ -89,7 +89,7 @@ expand_home (const char *append) str = malloc (len); if (str == NULL) { perror ("malloc"); - exit (1); + exit (EXIT_FAILURE); } strcpy (str, home); @@ -110,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; }