X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ftilde.c;h=4085417817d3b9ba14698d13134d6e24663d42d9;hb=fad78c609423fe10139b468ec229c3d6792718e2;hp=f0a225908458ba5da53975a58aa45170bb013ce4;hpb=2f1a50d81671810256dce0852e6b1e0810ac44af;p=libguestfs.git diff --git a/fish/tilde.c b/fish/tilde.c index f0a2259..4085417 100644 --- a/fish/tilde.c +++ b/fish/tilde.c @@ -30,7 +30,7 @@ #include "fish.h" static char *expand_home (const char *); -static const char *find_home_for_username (const char *, int); +static const char *find_home_for_username (const char *, size_t); /* This is called from the script loop if we find a candidate for * ~username (tilde-expansion). @@ -52,10 +52,8 @@ try_tilde_expansion (char *str) * username from the password file. */ else { - int len; const char *home, *rest; - - len = strcspn (&str[1], "/"); + size_t len = strcspn (&str[1], "/"); rest = &str[1+len]; home = find_home_for_username (&str[1], len); @@ -106,7 +104,7 @@ expand_home (const char *append) * or NULL if not found. */ static const char * -find_home_for_username (const char *username, int ulen) +find_home_for_username (const char *username, size_t ulen) { struct passwd *pw;