mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 00:38:14 +00:00
wacom-usb: Fix a false positive in real world firmware
Some files have a newline inbetween the AB sections.
This commit is contained in:
parent
5d4e70e9cc
commit
6817648c6b
@ -52,10 +52,15 @@ fu_wac_firmware_parse(FuFirmware *firmware,
|
||||
/* parse each line */
|
||||
lines = fu_common_strnsplit((const gchar *)data, len, "\n", -1);
|
||||
for (guint i = 0; lines[i] != NULL; i++) {
|
||||
g_autofree gchar *cmd = g_strndup(lines[i], 2);
|
||||
g_autofree gchar *cmd = NULL;
|
||||
|
||||
/* remove windows line endings */
|
||||
g_strdelimit(lines[i], "\r", '\0');
|
||||
cmd = g_strndup(lines[i], 2);
|
||||
|
||||
/* ignore blank lines */
|
||||
if (g_strcmp0(cmd, "") == 0)
|
||||
continue;
|
||||
|
||||
/* Wacom-specific metadata */
|
||||
if (g_strcmp0(cmd, "WA") == 0) {
|
||||
@ -191,7 +196,8 @@ fu_wac_firmware_parse(FuFirmware *firmware,
|
||||
g_set_error(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_INTERNAL,
|
||||
"invalid SREC command: %s",
|
||||
"invalid SREC command on line %u: %s",
|
||||
i + 1,
|
||||
cmd);
|
||||
return FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user