diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2015-04-04 19:29:34 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2015-04-04 19:29:34 +0200 |
commit | 05b30fbcc38cdc5dcd248f9b8385a9fec65f2d96 (patch) | |
tree | 2b9b3961facc3d6edb9292a026b1418dd0a6a1cc /storage/connect/xobject.cpp | |
parent | 836740cd8f638967ec55e4694f258a8a8642ae3b (diff) | |
download | mariadb-git-05b30fbcc38cdc5dcd248f9b8385a9fec65f2d96.tar.gz |
Fix MDEV-7890
Diffstat (limited to 'storage/connect/xobject.cpp')
-rw-r--r-- | storage/connect/xobject.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/storage/connect/xobject.cpp b/storage/connect/xobject.cpp index 817acb561fe..92bf039c07c 100644 --- a/storage/connect/xobject.cpp +++ b/storage/connect/xobject.cpp @@ -290,6 +290,34 @@ bool STRING::Set(char *s, uint n) } // end of Set /***********************************************************************/ +/* Append a char* to a STRING. */ +/***********************************************************************/ +bool STRING::Append(const char *s, uint ln) +{ + if (!s) + return false; + + uint len = Length + ln + 1; + + if (len > Size) { + char *p = Realloc(len); + + if (!p) + return true; + else if (p != Strp) { + strcpy(p, Strp); + Strp = p; + } // endif p + + } // endif n + + strncpy(Strp + Length, s, ln); + Length = len - 1; + Strp[Length] = 0; + return false; +} // end of Append + +/***********************************************************************/ /* Append a PSZ to a STRING. */ /***********************************************************************/ bool STRING::Append(PSZ s) |