From dac50e34ebf6e1db2c411ef2419770ec090daf15 Mon Sep 17 00:00:00 2001 From: Dylan Van Assche Date: Wed, 12 May 2021 18:25:40 +0200 Subject: [PATCH] at: log expected result before setting it to NULL Otherwise the log contains NULL instead of the expected value, making it hard to debug --- src/at.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/at.c b/src/at.c index 35ace26..c2bac9a 100644 --- a/src/at.c +++ b/src/at.c @@ -151,9 +151,9 @@ void at_process_result(struct EG25Manager *manager, if (at_cmd->expected && !strstr(response, at_cmd->expected)) { g_free(at_cmd->value); at_cmd->value = at_cmd->expected; - at_cmd->expected = NULL; g_message("Got a different result than expected, changing value..."); - g_message("\t%s\n\t%s", at_cmd->expected, response); + g_message("Expected: [%s]\nResponse: [%s]", at_cmd->expected, response); + at_cmd->expected = NULL; at_send_command(manager); } else { at_next_command(manager);