summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <jaylink-dev@marcschink.de>2016-08-04 17:52:32 +0200
committerMarc Schink <jaylink-dev@marcschink.de>2016-08-04 17:52:32 +0200
commitcff440a988cf12226cceb68064ca96870cf64a8d (patch)
treea18f82db677e2a68023b81c80849af495948daaa
parente7c5a2c0c394e4114e3ff6cdc6634fedabd1a0d7 (diff)
Use jaylink_parse_serial_number()HEADmaster
-rw-r--r--device_info.c4
-rw-r--r--efm32_debug_mode.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/device_info.c b/device_info.c
index c89c080..3385d6e 100644
--- a/device_info.c
+++ b/device_info.c
@@ -126,7 +126,9 @@ int main(int argc, char **argv)
use_serial_number = false;
if (argc > 1) {
- if (sscanf(argv[1], "%" PRIu32, &serial_number) != 1) {
+ ret = jaylink_parse_serial_number(argv[1], &serial_number);
+
+ if (ret != JAYLINK_OK) {
printf("Failed to parse serial number: %s.\n",
argv[1]);
return EXIT_FAILURE;
diff --git a/efm32_debug_mode.c b/efm32_debug_mode.c
index 877cefe..1c503cb 100644
--- a/efm32_debug_mode.c
+++ b/efm32_debug_mode.c
@@ -85,7 +85,9 @@ int main(int argc, char **argv)
use_serial_number = false;
if (argc > 2) {
- if (sscanf(argv[2], "%" PRIu32, &serial_number) != 1) {
+ ret = jaylink_parse_serial_number(argv[2], &serial_number);
+
+ if (ret != JAYLINK_OK) {
printf("Failed to parse serial number: %s.\n",
argv[2]);
return EXIT_FAILURE;