From 948bad1ed9b5d60b98a767200c79fcedd2fc260d Mon Sep 17 00:00:00 2001 From: Dominika Maziec Date: Fri, 27 Sep 2019 16:02:24 +0200 Subject: [PATCH] ATCmdParser doxygen header's documentation scanf --- platform/ATCmdParser.h | 3 +++ platform/source/ATCmdParser.cpp | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/ATCmdParser.h b/platform/ATCmdParser.h index d9a6e985437..c48235f7155 100644 --- a/platform/ATCmdParser.h +++ b/platform/ATCmdParser.h @@ -271,6 +271,9 @@ class ATCmdParser : private NonCopyable { /** * Direct scanf on underlying stream + * This function does not itself match whitespace in its format string, so \n is not significant to it. + * It should be used only when certain string is needed or format ends with certain character, otherwise + * it will fill the output with one character. * @see scanf * * @param format Format string to pass to scanf diff --git a/platform/source/ATCmdParser.cpp b/platform/source/ATCmdParser.cpp index 6f01a3ea790..c37d525f184 100644 --- a/platform/source/ATCmdParser.cpp +++ b/platform/source/ATCmdParser.cpp @@ -309,7 +309,6 @@ bool ATCmdParser::vrecv(const char *response, std::va_list args) if (whole_line_wanted && c != '\n') { // Don't attempt scanning until we get delimiter if they included it in format // This allows recv("Foo: %s\n") to work, and not match with just the first character of a string - // (scanf does not itself match whitespace in its format string, so \n is not significant to it) } else if (response) { sscanf(_buffer + offset, _buffer, &count); }