Improve error message.

This commit is contained in:
wb2osz 2024-09-28 01:58:16 +01:00
parent 0734e46134
commit b26c5a4d7d
1 changed files with 3 additions and 2 deletions

View File

@ -528,7 +528,7 @@ static int mice_cmp (const void *px, const void *py)
void deviceid_decode_dest (char *dest, char *device, size_t device_size) void deviceid_decode_dest (char *dest, char *device, size_t device_size)
{ {
*device = '\0'; strlcpy (device, "UNKNOWN vendor/model", device_size);
if (ptocalls == NULL) { if (ptocalls == NULL) {
text_color_set(DW_COLOR_ERROR); text_color_set(DW_COLOR_ERROR);
@ -554,6 +554,7 @@ void deviceid_decode_dest (char *dest, char *device, size_t device_size)
} }
} }
// Not found in table.
strlcpy (device, "UNKNOWN vendor/model", device_size); strlcpy (device, "UNKNOWN vendor/model", device_size);
} // end deviceid_decode_dest } // end deviceid_decode_dest
@ -610,7 +611,7 @@ static inline int strncmp_z (char *a, char *b, size_t len)
void deviceid_decode_mice (char *comment, char *trimmed, size_t trimmed_size, char *device, size_t device_size) void deviceid_decode_mice (char *comment, char *trimmed, size_t trimmed_size, char *device, size_t device_size)
{ {
*device = '\0'; strlcpy (device, "UNKNOWN vendor/model", device_size);
if (ptocalls == NULL) { if (ptocalls == NULL) {
text_color_set(DW_COLOR_ERROR); text_color_set(DW_COLOR_ERROR);