diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-07-04 22:02:54 +0200 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-07-07 12:16:09 +0200 |
commit | 29f72aa63844967cfd56d2edce804af243ef3ddd (patch) | |
tree | 6ebb4beff3bc26d053a45aaaf3c7e5f75e845af8 /src/revparse.c | |
parent | 98d6a1fdda5fa0605dee933930b5b7ddff4feb37 (diff) | |
download | libgit2-29f72aa63844967cfd56d2edce804af243ef3ddd.tar.gz |
revparse: leverage git__isdigit()
Diffstat (limited to 'src/revparse.c')
-rw-r--r-- | src/revparse.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/revparse.c b/src/revparse.c index f5cf93ba2..3b9b2c903 100644 --- a/src/revparse.c +++ b/src/revparse.c @@ -115,10 +115,11 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const static int all_chars_are_digits(const char *str, size_t len) { - size_t i=0; - for (i=0; i<len; i++) { - if (str[i] < '0' || str[i] > '9') return 0; - } + size_t i = 0; + + for (i = 0; i < len; i++) + if (!git__isdigit(str[i])) return 0; + return 1; } |