From: robertl Date: Tue, 18 Jan 2005 19:15:32 +0000 (+0000) Subject: Handle case when mkshort has NO valid name. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~3822 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4ae9d1d5009945dd7aee7f9346846bddeca41a6e;p=gpsbabel.git Handle case when mkshort has NO valid name. --- diff --git a/gpsbabel/mkshort.c b/gpsbabel/mkshort.c index 19ec3a51e..5f40e1803 100644 --- a/gpsbabel/mkshort.c +++ b/gpsbabel/mkshort.c @@ -386,6 +386,14 @@ mkshort(void *h, const char *istring) strcpy(&ostring[hdl->target_len] - strlen(np), np); } + /* + * If, after all that, we have an empty string, punt and + * let the must_uniq code handle it. + */ + if (ostring[0] == '\0') { + ostring = xstrdup("WPT"); + } + if (hdl->must_uniq) { return mkshort_add_to_list(hdl, ostring); }