mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-21 23:07:39 +00:00
tpm: Optimize the string parsing and fix the boolean logic
The g_ascii_isgraph() correctly handles NUL so just remove the check rather than adding brackets around the logic.
This commit is contained in:
parent
04fde48e9a
commit
b27f0d42f9
@ -75,7 +75,7 @@ fu_tpm_device_get_string (ESYS_CONTEXT *ctx, guint32 query, GError **error)
|
|||||||
|
|
||||||
/* convert non-ASCII into spaces */
|
/* convert non-ASCII into spaces */
|
||||||
for (guint i = 0; i < 4; i++) {
|
for (guint i = 0; i < 4; i++) {
|
||||||
if (!g_ascii_isgraph (result[i]) && result[i] != '\0')
|
if (!g_ascii_isgraph (result[i]))
|
||||||
result[i] = 0x20;
|
result[i] = 0x20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user