mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 15:22:20 +02:00
at: escape non text characters in modem response logs
This commit is contained in:
5
src/at.c
5
src/at.c
@@ -241,12 +241,15 @@ static gboolean modem_response(gint fd,
|
|||||||
} while (ret > 0 && pos < (sizeof(response) - 1));
|
} while (ret > 0 && pos < (sizeof(response) - 1));
|
||||||
|
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
|
g_autofree gchar *escaped = NULL;
|
||||||
|
|
||||||
response[pos] = 0;
|
response[pos] = 0;
|
||||||
g_strstrip(response);
|
g_strstrip(response);
|
||||||
if (strlen(response) == 0)
|
if (strlen(response) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
g_message("Response: [%s]", response);
|
escaped = g_strescape(response, "\"");
|
||||||
|
g_message("Response: [%s]", escaped);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When the modem is started, it outputs 'RDY' to indicate that
|
* When the modem is started, it outputs 'RDY' to indicate that
|
||||||
|
Reference in New Issue
Block a user