diff options
author | Beat Bolli <bbolli@ewanet.ch> | 2013-11-09 15:28:48 +0100 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-10 00:52:40 -0500 |
commit | 131e55344be3a37b56b9671644f38bb964abe175 (patch) | |
tree | f2894a001f307b5f97191064a9c71f021bb6796a /cgps.c | |
parent | 170c15b35650427daa47fd8f70676daa1736343f (diff) | |
download | gpsd-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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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. */ |