mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue