linux/freebsd: Do not print invalid characters into log

Instead, just hex-encode them, they are invalid, it is not like having
them in raw in the log is helpful.
This commit is contained in:
Benjamin Berg 2022-05-10 10:23:59 +02:00
parent 26dee1fe3f
commit b0f1e28b42
2 changed files with 2 additions and 2 deletions

View file

@ -145,7 +145,7 @@ up_make_safe_string (const gchar *text)
ret[idx] = ret[i];
idx++;
} else {
g_debug ("invalid char '%c'", ret[i]);
g_debug ("invalid char 0x%02X", ret[i]);
}
}

View file

@ -431,7 +431,7 @@ up_device_supply_make_safe_string (gchar *text)
text[idx] = text[i];
idx++;
} else {
g_debug ("invalid char '%c'", text[i]);
g_debug ("invalid char: 0x%02X", text[i]);
}
}