diff options
author | Karel Zak | 2013-01-28 16:16:11 +0100 |
---|---|---|
committer | Karel Zak | 2013-03-11 13:00:54 +0100 |
commit | 416c43a9a5519ae0e4c91e075cf42c5cf0b5cbcb (patch) | |
tree | e80ace8d76f33e4a63a2df58c1a35597e104d130 /lib/strutils.c | |
parent | libfdisk: add "ask" interface (diff) | |
download | kernel-qcow2-util-linux-416c43a9a5519ae0e4c91e075cf42c5cf0b5cbcb.tar.gz kernel-qcow2-util-linux-416c43a9a5519ae0e4c91e075cf42c5cf0b5cbcb.tar.xz kernel-qcow2-util-linux-416c43a9a5519ae0e4c91e075cf42c5cf0b5cbcb.zip |
fdisk: add callback for ask-numbers API
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/strutils.c')
-rw-r--r-- | lib/strutils.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/strutils.c b/lib/strutils.c index 2337b07b9..8e8ab2f37 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -132,6 +132,16 @@ err: return -1; } +int isdigit_string(const char *str) +{ + const char *p; + + for (p = str; p && *p && isdigit((unsigned char) *p); p++); + + return p && p > str && !*p; +} + + #ifndef HAVE_MEMPCPY void *mempcpy(void *restrict dest, const void *restrict src, size_t n) { |