1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Make this repository aligned with 10.0 one

This commit is contained in:
Olivier Bertrand
2015-04-05 14:03:35 +02:00
parent 464947e632
commit 48a77e6188
17 changed files with 992 additions and 687 deletions

View File

@@ -289,6 +289,34 @@ bool STRING::Set(char *s, uint n)
return false;
} // 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. */
/***********************************************************************/