From 3b879467b11ee727bba93969868beeefa72a097d Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Sat, 10 Oct 2015 22:30:56 +0800 Subject: btrfs-progs: move is_numerical() helper to utils and rename Signed-off-by: Anand Jain [ moved to util.c and renamed ] Signed-off-by: David Sterba --- cmds-replace.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'cmds-replace.c') diff --git a/cmds-replace.c b/cmds-replace.c index 9596f2ab..375a4608 100644 --- a/cmds-replace.c +++ b/cmds-replace.c @@ -65,17 +65,6 @@ static const char * const replace_cmd_group_usage[] = { NULL }; -static int is_numerical(const char *str) -{ - if (!(*str >= '0' && *str <= '9')) - return 0; - while (*str >= '0' && *str <= '9') - str++; - if (*str != '\0') - return 0; - return 1; -} - static int dev_replace_cancel_fd = -1; static void dev_replace_sigint_handler(int signal) { @@ -214,7 +203,7 @@ static int cmd_replace_start(int argc, char **argv) goto leave_with_error; } - if (is_numerical(srcdev)) { + if (string_is_numerical(srcdev)) { struct btrfs_ioctl_fs_info_args fi_args; struct btrfs_ioctl_dev_info_args *di_args = NULL; -- cgit v1.2.3