From 26d107923b332a3439a8347c33a1125622f54bec Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 9 Jan 2017 16:33:52 -0800 Subject: [PATCH] motor_test: fix use of negative channel --- src/systemcmds/motor_test/motor_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/systemcmds/motor_test/motor_test.c b/src/systemcmds/motor_test/motor_test.c index 66bb60da39..658c03a023 100644 --- a/src/systemcmds/motor_test/motor_test.c +++ b/src/systemcmds/motor_test/motor_test.c @@ -112,7 +112,7 @@ int motor_test_main(int argc, char *argv[]) case 'm': /* Read in motor number */ - channel = (int)strtoul(myoptarg, NULL, 0); + channel = (int)strtol(myoptarg, NULL, 0); break; case 'p': @@ -153,7 +153,7 @@ int motor_test_main(int argc, char *argv[]) } if (run_test) { - if (channel == -1) { + if (channel < 0) { for (int i = 0; i < 8; ++i) { motor_test(i, value); usleep(10000);