Skip to content

Commit

Permalink
Looks like this bug discovered in late Jan 2014 never got its fix che…
Browse files Browse the repository at this point in the history
…cked in. Dan had discussed it with Henry on 24 Jan 2014. Dan incorrectly assumed that a fix had been checked in. Apparently not; Henry's last checkin was 8 Jan 2014 and there was not fix for this issue.
  • Loading branch information
dcnewman committed Apr 20, 2015
1 parent 0b7241c commit 031054c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/gpx/gpx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1915,6 +1915,8 @@ static int factory_defaults(Gpx *gpx)

static int start_build(Gpx *gpx, const char * filename)
{
size_t len;

begin_frame(gpx);

write_8(gpx, 153);
Expand All @@ -1923,7 +1925,17 @@ static int start_build(Gpx *gpx, const char * filename)
write_32(gpx, 0);

// 1+N bytes: Name of the build, in ASCII, null terminated
write_string(gpx, filename, strlen(filename));
// 32 bytes max in a payload
// 4 bytes used for "reserved"
// 1 byte used for NUL terminator
// that leaves 27 bytes for the build name
// (But the LCD actually has far less room)
// We'll just truncate at 24
if (!filename)
filename = "GPX";
len = strlen(filename);
if (len > 24) len = 24;
write_string(gpx, filename, len);

return end_frame(gpx);
}
Expand Down

0 comments on commit 031054c

Please sign in to comment.