Skip to content

ATCmdParser doxygen header's documentation update for scanf #11587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions platform/ATCmdParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ class ATCmdParser : private NonCopyable<ATCmdParser> {

/**
* 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
Expand Down
1 change: 0 additions & 1 deletion platform/source/ATCmdParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down