Skip to content

Commit 59c3663

Browse files
hanxu-nxpnxpfrankli
authored andcommitted
fix: the console print exception issue
When the console window width is less than 68 columns, console prints "notify exception: invalid string position". The root cause is start position is out of range. Signed-off-by: Han Xu <han.xu@nxp.com>
1 parent 051561b commit 59c3663

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

uuu/uuu.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ void print_auto_scroll(string str, size_t len, size_t start)
344344
str[str.size() - 1] = '.';
345345
str[str.size() - 2] = '.';
346346
str[str.size() - 3] = '.';
347+
start = start % str.size();
347348
}
348349

349350
string s = str.substr(start, len);

0 commit comments

Comments
 (0)