diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-05-07 00:27:50 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-06 15:35:22 -0700 |
commit | 7c3b68e3aeca1e6e51596f475d6fd5f286079794 (patch) | |
tree | 37e929b502ff7425bc7ddb7a6e4f1b0a9612b2cf /save-xml.c | |
parent | 7b0b5d9643d31e9b3ad260841011b81ec18eff8a (diff) | |
download | subsurface-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>
Diffstat (limited to 'save-xml.c')
-rw-r--r-- | save-xml.c | 2 |
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; } |