diff options
Diffstat (limited to 'lib/frrstr.c')
| -rw-r--r-- | lib/frrstr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/frrstr.c b/lib/frrstr.c index 82c0ad7730..715e67b868 100644 --- a/lib/frrstr.c +++ b/lib/frrstr.c @@ -161,3 +161,11 @@ bool begins_with(const char *str, const char *prefix) return strncmp(str, prefix, lenprefix) == 0; } + +int all_digit(const char *str) +{ + for (; *str != '\0'; str++) + if (!isdigit((int)*str)) + return 0; + return 1; +} |
