diff --git a/statistics.c b/statistics.c index 6a6d177f4..fbb739791 100644 --- a/statistics.c +++ b/statistics.c @@ -365,5 +365,7 @@ char *get_gaslist(struct dive *dive) } if (*buf == '\0') strncpy(buf, translate("gettextFromC","air"), MAXBUF); + + buf[MAXBUF - 1] = '\0'; return buf; }