gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH] cgps: don't overwrite partial lines in the message du


From: Beat Bolli
Subject: [gpsd-dev] [PATCH] cgps: don't overwrite partial lines in the message dump.
Date: Sat, 9 Nov 2013 15:28:48 +0100

Signed-off-by: Beat Bolli <address@hidden>
---
 cgps.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cgps.c b/cgps.c
index f59c700..ac010c7 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. */
-- 
1.8.4.rc3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]