diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2019-10-16 22:12:47 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2019-10-16 22:12:47 +0200 |
commit | a00b713130626a6e91864fdee3f2b264cbe82ac6 (patch) | |
tree | 63110a0fefe779360d94c76d7d33b3efcb90f0ec /storage/connect/value.cpp | |
parent | b56589eaf2c7dcaabcacfddd05fde44023287f29 (diff) | |
download | mariadb-git-a00b713130626a6e91864fdee3f2b264cbe82ac6.tar.gz |
Fix wrong second parameter in snprintf
Diffstat (limited to 'storage/connect/value.cpp')
-rw-r--r-- | storage/connect/value.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<TYPE>::GetBinValue(void *buf, int buflen, bool go) template <class TYPE> int TYPVAL<TYPE>::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<double>::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 /***********************************************************************/ |