mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
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:
parent
0233239198
commit
fd983a0992
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue