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:
Anton Lundin 2014-05-07 00:27:50 +02:00 committed by Dirk Hohndel
parent 7b0b5d9643
commit 7c3b68e3ae

View file

@ -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;
}