From 98c92a6d18d943acdebeb42bac24845f925fe4f2 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sun, 13 Dec 2020 13:21:23 +0100 Subject: [PATCH] hosted: Really fix the case of no serial number (#807) --- src/platforms/hosted/bmp_libusb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platforms/hosted/bmp_libusb.c b/src/platforms/hosted/bmp_libusb.c index e29344b..06134a3 100644 --- a/src/platforms/hosted/bmp_libusb.c +++ b/src/platforms/hosted/bmp_libusb.c @@ -36,13 +36,15 @@ #define VENDOR_ID_SEGGER 0x1366 +#define NO_SERIAL_NUMBER "" + void bmp_ident(bmp_info_t *info) { DEBUG_INFO("BMP hosted %s\n for ST-Link V2/3, CMSIS_DAP, JLINK and " "LIBFTDI/MPSSE\n", FIRMWARE_VERSION); if (info && info->vid && info->pid) DEBUG_INFO("Using %04x:%04x %s %s\n %s\n", info->vid, info->pid, - info->serial, + (info->serial[0]) ? info->serial : NO_SERIAL_NUMBER, info->manufacturer, info->product); } @@ -233,11 +235,9 @@ int find_debuggers(BMP_CL_OPTIONS_t *cl_opts,bmp_info_t *info) if (!cable->name) continue; } - if (!serial[0]) - strcpy(serial, ""); if (report) { DEBUG_WARN("%2d: %s, %s, %s\n", found_debuggers + 1, - serial, + (serial[0]) ? serial : NO_SERIAL_NUMBER, manufacturer,product); } info->vid = desc.idVendor;