Skip to content

Commit 8734a57

Browse files
authored
example/linux-example: add newline in printf format (#49)
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
1 parent 16801ec commit 8734a57

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

examples/linux-example/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void onAdc(EmbeddedCli *cli, char *args, void *context);
2929
int main() {
3030
// Single character buffer for reading keystrokes
3131
unsigned char c;
32-
32+
3333
// Structures to save the terminal settings for original settings & raw mode
3434
struct termios original_stdin;
3535
struct termios raw_stdin;
@@ -95,15 +95,15 @@ int main() {
9595

9696
// restore terminal settings
9797
tcsetattr(STDIN_FILENO, TCSANOW, &original_stdin);
98-
98+
9999
return 0;
100100
}
101101

102102
void onCommand(const std::string &name, char *tokens) {
103-
std::cout << "Received command: " << name << "\n";
103+
std::cout << "Received command: " << name << "\r\n";
104104

105105
for (int i = 0; i < embeddedCliGetTokenCount(tokens); ++i) {
106-
std::cout << "Arg " << i << ": " << embeddedCliGetToken(tokens, i + 1) << "\n";
106+
std::cout << "Arg " << i << ": " << embeddedCliGetToken(tokens, i + 1) << "\r\n";
107107
}
108108
}
109109

0 commit comments

Comments
 (0)