Use ctype to make alldigits simpler.

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@568 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Andreas Schneider
2009-04-20 14:09:21 +00:00
parent e067061263
commit afe0c8b2b5

View File

@@ -968,16 +968,21 @@ STRING *publickey_from_next_file(SSH_SESSION *session, const char **pub_keys_pat
return pubkey;
}
static int alldigits(char *s)
{
while (*s) {
if (((*s) < '0') || ((*s) > '9')) return 0;
s++;
}
return 1;
static int alldigits(const char *s) {
while (*s) {
if (isdigit(*s)) {
s++;
} else {
return 0;
}
}
return 1;
}
/** @}
*/
/** \addtogroup ssh_session
* @{ */