Terminate the string before relying on strlen
Its a c-string we put, so it must be null-terminated. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7b0b5d9643
commit
7c3b68e3ae
@ -191,7 +191,7 @@ static void show_location(struct membuffer *b, struct dive *dive)
|
||||
|
||||
len += format_location(buffer + len, latitude, longitude);
|
||||
if (!dive->location) {
|
||||
memcpy(buffer + len, "/>\n", 4);
|
||||
memcpy(buffer + len, "/>\n\0", 5);
|
||||
put_string(b, buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user