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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-12-28 18:30:02 -08:00
parent 0233239198
commit fd983a0992

View file

@ -109,7 +109,9 @@ static void uemis_get_index(char *buffer, int *idx)
/* space separated */ /* space separated */
static void uemis_add_string(char *buffer, char **text) 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; return;
if (!*text) { if (!*text) {
*text = strdup(buffer); *text = strdup(buffer);