Skip to content

Commit

Permalink
Fix off-by-one check for stripping the quote from NAME/UNIQ
Browse files Browse the repository at this point in the history
This never stripped the quote off.

Fixes: 6026b34 ("Fetch the name and uniq from udev properties, not sysfs (#708)")
  • Loading branch information
whot committed Jun 11, 2024
1 parent dea975e commit 4af8b6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libwacom/libwacom.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ get_device_prop(GUdevDevice *device, const char *propname)
/* NAME and UNIQ properties are enclosed with quotes */
size_t offset = v[0] == '"' ? 1 : 0;
value = g_strdup(v + offset);
if (value[strlen(value)] == '"')
value[strlen(value)] = '\0';
if (value[strlen(value) - 1] == '"')
value[strlen(value) - 1] = '\0';
break;
}
next = g_udev_device_get_parent (parent);
Expand Down

0 comments on commit 4af8b6f

Please sign in to comment.