Skip to content

Commit b26c5a4

Browse files
committed
Improve error message.
1 parent 0734e46 commit b26c5a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/deviceid.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static int mice_cmp (const void *px, const void *py)
528528

529529
void deviceid_decode_dest (char *dest, char *device, size_t device_size)
530530
{
531-
*device = '\0';
531+
strlcpy (device, "UNKNOWN vendor/model", device_size);
532532

533533
if (ptocalls == NULL) {
534534
text_color_set(DW_COLOR_ERROR);
@@ -554,6 +554,7 @@ void deviceid_decode_dest (char *dest, char *device, size_t device_size)
554554
}
555555
}
556556

557+
// Not found in table.
557558
strlcpy (device, "UNKNOWN vendor/model", device_size);
558559

559560
} // end deviceid_decode_dest
@@ -610,7 +611,7 @@ static inline int strncmp_z (char *a, char *b, size_t len)
610611

611612
void deviceid_decode_mice (char *comment, char *trimmed, size_t trimmed_size, char *device, size_t device_size)
612613
{
613-
*device = '\0';
614+
strlcpy (device, "UNKNOWN vendor/model", device_size);
614615

615616
if (ptocalls == NULL) {
616617
text_color_set(DW_COLOR_ERROR);

0 commit comments

Comments
 (0)