summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;