From 7c3b68e3aeca1e6e51596f475d6fd5f286079794 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Wed, 7 May 2014 00:27:50 +0200 Subject: Terminate the string before relying on strlen Its a c-string we put, so it must be null-terminated. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- save-xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/save-xml.c b/save-xml.c index 54a0a8606..227b95296 100644 --- a/save-xml.c +++ b/save-xml.c @@ -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; } -- cgit v1.2.3-70-g09d2