summaryrefslogtreecommitdiff
path: root/cgps.c
diff options
context:
space:
mode:
authorBeat Bolli <bbolli@ewanet.ch>2013-11-09 15:28:48 +0100
committerEric S. Raymond <esr@thyrsus.com>2013-11-10 00:52:40 -0500
commit131e55344be3a37b56b9671644f38bb964abe175 (patch)
treef2894a001f307b5f97191064a9c71f021bb6796a /cgps.c
parent170c15b35650427daa47fd8f70676daa1736343f (diff)
downloadgpsd-131e55344be3a37b56b9671644f38bb964abe175.tar.gz
cgps: don't overwrite partial lines in the message dump.
Signed-off-by: Beat Bolli <bbolli@ewanet.ch> Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'cgps.c')
-rw-r--r--cgps.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cgps.c b/cgps.c
index f59c700b..ac010c79 100644
--- a/cgps.c
+++ b/cgps.c
@@ -96,6 +96,7 @@
#ifndef S_SPLINT_S
#include <unistd.h>
#endif /* S_SPLINT_S */
+#include <ctype.h>
#include "gpsd_config.h"
#include "gps.h"
@@ -640,7 +641,10 @@ static void update_gps_panel(struct gps_data_t *gpsdata)
/* Be quiet if the user requests silence. */
if (!silent_flag && raw_flag && (s = (char *)gps_data(gpsdata)) != NULL) {
- (void)waddstr(messages, s);
+ char *p;
+ for (p = s + strlen(s); --p > s && isspace(*p); *p = '\0')
+ ;
+ (void)wprintw(messages, "%s\n", s);
}
/* Reset the status_timer if the state has changed. */