diff options
| author | paco <paco@voltanet.io> | 2018-06-19 17:59:53 +0200 |
|---|---|---|
| committer | paco <paco@voltanet.io> | 2018-06-19 17:59:53 +0200 |
| commit | 5d5ba0185dd63e5443a9c005f8b369b17e82ab03 (patch) | |
| tree | 888436e6de484cc8a838d063b68880919f0855bd /lib/frrstr.c | |
| parent | 447297f34faa21a1436018caa213de216a93bc65 (diff) | |
bgpd, lib, ospfd, zebra: all_digit moved to frrstr
This solves a pending FIXME
Signed-off-by: F. Aragon <paco@voltanet.io>
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; +} |
