aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-05-07 00:27:50 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-06 15:35:22 -0700
commit7c3b68e3aeca1e6e51596f475d6fd5f286079794 (patch)
tree37e929b502ff7425bc7ddb7a6e4f1b0a9612b2cf
parent7b0b5d9643d31e9b3ad260841011b81ec18eff8a (diff)
downloadsubsurface-7c3b68e3aeca1e6e51596f475d6fd5f286079794.tar.gz
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>
-rw-r--r--save-xml.c2
1 files changed, 1 insertions, 1 deletions
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;
}