summaryrefslogtreecommitdiff
path: root/storage/connect
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2019-10-16 22:12:47 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2019-10-16 22:12:47 +0200
commita00b713130626a6e91864fdee3f2b264cbe82ac6 (patch)
tree63110a0fefe779360d94c76d7d33b3efcb90f0ec /storage/connect
parentb56589eaf2c7dcaabcacfddd05fde44023287f29 (diff)
downloadmariadb-git-a00b713130626a6e91864fdee3f2b264cbe82ac6.tar.gz
Fix wrong second parameter in snprintf
Diffstat (limited to 'storage/connect')
-rw-r--r--storage/connect/value.cpp4
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
/***********************************************************************/