diff options
Diffstat (limited to 'libssh/keyfiles.c')
-rw-r--r-- | libssh/keyfiles.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c index 5242ee4..debfbb7 100644 --- a/libssh/keyfiles.c +++ b/libssh/keyfiles.c @@ -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 * @{ */ |