Remove newlines from debug output

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1285 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2006-01-07 23:19:55 +00:00
parent e260b697fc
commit d42f707d14

View File

@@ -767,7 +767,19 @@ nm_utils_supplicant_request_with_check (struct wpa_ctrl *ctrl,
wpa_ctrl_request (ctrl, command, strlen (command), response, &len, NULL);
response[len] = '\0';
#ifdef SUPPLICANT_DEBUG
{
gboolean newline = FALSE;
/* Kill the newline for the debug message */
if (response[len - 1] == '\n')
{
newline = TRUE;
response[len - 1] = '\0';
}
nm_info ("SUP: response was '%s'", response);
if (newline)
response[len - 1] = '\n';
}
#endif
if (response)
@@ -776,10 +788,22 @@ nm_utils_supplicant_request_with_check (struct wpa_ctrl *ctrl,
success = TRUE;
else
{
gboolean newline = FALSE;
/* Kill the newline for the debug message */
if (response[len - 1] == '\n')
{
newline = TRUE;
response[len - 1] = '\0';
}
temp = g_strdup_printf ("%s: supplicant error for '%s'. Response: '%s'",
func, err_msg_cmd ? err_msg_cmd : command, response);
nm_warning_str (temp);
g_free (temp);
if (newline)
response[len - 1] = '\n';
}
g_free (response);
}