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 d003590ba6..1f0849566a 100644 --- a/lib/frrstr.c +++ b/lib/frrstr.c @@ -158,3 +158,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; +} |
