Re: [Gpsbabel-code] Garmin Track Name patch
Brought to you by:
robertl
From: Robert L. <rob...@us...> - 2004-02-04 02:04:07
|
gt...@gm... wrote: > This patch names tracks after the identifiers found in the Garmin device. Subsequent track segments of the same track are named Trackname #2, Trackname #3, etc. Lovely. > If the tab indents are messed up, tell me and I can send an attachment. I was able to work with that. > + trk_name = array[i]->trk_ident; > + if (!trk_name) I'm about 98% sure this will never be taken. trk_name will be a character pointer pointing to the base element of the trk_ident character array. If you think trk_ident can be empty, I think the test you want is if(!trk_name[0]) I haven't actually made this change since I can't test it and it is a behavioural change. > + snprintf(trk_seg_num_buf, 10, "%d", trk_seg_num); I replaced that 10 with sizeof(trk_sg...) but applied this otherwise unchanged. If you'd take a closer look at the above test, that would be great. Even if it's "wrong", we're better off than we were before. Thanx, RJL |