Bugfix: the code tried to shave off the ending newline character even if it did not exist
This commit is contained in:
parent
e0b821e448
commit
7b87c2f5dc
1 changed files with 3 additions and 3 deletions
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki desktop OS.
|
* This file is part of the Contiki desktop OS.
|
||||||
*
|
*
|
||||||
* $Id: telnetd.c,v 1.12 2008/02/28 23:59:27 oliverschmidt Exp $
|
* $Id: telnetd.c,v 1.13 2008/10/31 18:07:13 adamdunkels Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -158,10 +158,10 @@ shell_prompt(char *str)
|
||||||
void
|
void
|
||||||
shell_default_output(const char *str1, int len1, const char *str2, int len2)
|
shell_default_output(const char *str1, int len1, const char *str2, int len2)
|
||||||
{
|
{
|
||||||
if(str1[len1 - 1] == '\n') {
|
if(len1 > 0 && str1[len1 - 1] == '\n') {
|
||||||
--len1;
|
--len1;
|
||||||
}
|
}
|
||||||
if(str2[len2 - 1] == '\n') {
|
if(len2 > 0 && str2[len2 - 1] == '\n') {
|
||||||
--len2;
|
--len2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue