From fd983a0992b285963d6f91ea1c99abfa2d269f60 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 28 Dec 2012 18:30:02 -0800 Subject: Don't store notes that are just one space on the Uemis Sometimes the Uemis appears to return " " as notes instead of no notes. This patch filters this out (otherwise redownloading divecomputers can cause silly things like notes that say "(existing note) or ( )" ) Signed-off-by: Dirk Hohndel --- uemis-downloader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'uemis-downloader.c') diff --git a/uemis-downloader.c b/uemis-downloader.c index 90f3d2317..465437aa6 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -109,7 +109,9 @@ static void uemis_get_index(char *buffer, int *idx) /* space separated */ static void uemis_add_string(char *buffer, char **text) { - if (!buffer || !*buffer) + /* do nothing if this is an empty buffer (Uemis sometimes returns a single + * space for empty buffers) */ + if (!buffer || !*buffer || (*buffer == ' ' && *(buffer + 1) == '\0')) return; if (!*text) { *text = strdup(buffer); -- cgit v1.2.3-70-g09d2