Skip to content

Commit

Permalink
Improve error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
wb2osz committed Sep 28, 2024
1 parent 0734e46 commit b26c5a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/deviceid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
*device = '\0';
strlcpy (device, "UNKNOWN vendor/model", device_size);

if (ptocalls == NULL) {
text_color_set(DW_COLOR_ERROR);
Expand All @@ -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);

} // end deviceid_decode_dest
Expand Down Expand Up @@ -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)
{
*device = '\0';
strlcpy (device, "UNKNOWN vendor/model", device_size);

if (ptocalls == NULL) {
text_color_set(DW_COLOR_ERROR);
Expand Down

0 comments on commit b26c5a4

Please sign in to comment.