From a00b713130626a6e91864fdee3f2b264cbe82ac6 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 16 Oct 2019 22:12:47 +0200 Subject: Fix wrong second parameter in snprintf --- storage/connect/value.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'storage/connect') diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 158495de26c..df75722d0e8 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -884,14 +884,14 @@ bool TYPVAL::GetBinValue(void *buf, int buflen, bool go) template int TYPVAL::ShowValue(char *buf, int len) { - return snprintf(buf, len, Xfmt, len, Tval); + return snprintf(buf, len + 1, Xfmt, len, Tval); } // end of ShowValue template <> int TYPVAL::ShowValue(char *buf, int len) { // TODO: use a more appropriate format to avoid possible truncation - return snprintf(buf, len, Xfmt, len, Prec, Tval); + return snprintf(buf, len + 1, Xfmt, len, Prec, Tval); } // end of ShowValue /***********************************************************************/ -- cgit v1.2.1