mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
62884b8f36
Fixes for Innobase Don't reset whole to-buffer in strxnmov BUILD/compile-pentium-debug: Added innobase include/mysqld_error.h: New error messages innobase/configure.in: Update from heikki innobase/include/lock0types.h: Update from heikki innobase/include/os0sync.h: Update from heikki innobase/include/sync0types.h: Update from heikki innobase/os/os0file.c: Update from heikki innobase/srv/srv0start.c: Update from heikki sql/ha_innobase.cc: Update from Heikki Changed assert -> dbug_assert Changed return -> DBUG_RETURN sql/mysql_priv.h: Added max_user_connections sql/mysqld.cc: Added max_user_connections sql/share/czech/errmsg.txt: Added max_user_connections sql/share/danish/errmsg.txt: Added max_user_connections sql/share/dutch/errmsg.txt: Added max_user_connections sql/share/english/errmsg.txt: Added max_user_connections sql/share/estonian/errmsg.txt: Added max_user_connections sql/share/french/errmsg.txt: Added max_user_connections sql/share/german/errmsg.txt: Added max_user_connections sql/share/greek/errmsg.txt: Added max_user_connections sql/share/hungarian/errmsg.txt: Added max_user_connections sql/share/italian/errmsg.txt: Added max_user_connections sql/share/japanese/errmsg.txt: Added max_user_connections sql/share/korean/errmsg.txt: Added max_user_connections sql/share/norwegian-ny/errmsg.txt: Added max_user_connections sql/share/norwegian/errmsg.txt: Added max_user_connections sql/share/polish/errmsg.txt: Added max_user_connections sql/share/portuguese/errmsg.txt: Added max_user_connections sql/share/romanian/errmsg.txt: Added max_user_connections sql/share/russian/errmsg.txt: Added max_user_connections sql/share/slovak/errmsg.txt: Added max_user_connections sql/share/spanish/errmsg.txt: Added max_user_connections sql/share/swedish/errmsg.OLD: Added max_user_connections sql/share/swedish/errmsg.txt: Added max_user_connections sql/sql_class.h: cleanup strings/str_test.c: Added tests for strxnmov strings/strxnmov.c: Don't reset whole to buffer
48 lines
1.4 KiB
C
48 lines
1.4 KiB
C
/* File : strxnmov.c
|
|
Author : Richard A. O'Keefe.
|
|
Updated: 2 June 1984
|
|
Defines: strxnmov()
|
|
|
|
strxnmov(dst, len, src1, ..., srcn, NullS)
|
|
moves the first len characters of the concatenation of src1,...,srcn
|
|
to dst. If there aren't that many characters, a NUL character will
|
|
be added to the end of dst to terminate it properly. This gives the
|
|
same effect as calling strxcpy(buff, src1, ..., srcn, NullS) with a
|
|
large enough buffer, and then calling strnmov(dst, buff, len).
|
|
It is just like strnmov except that it concatenates multiple sources.
|
|
Beware: the last argument should be the null character pointer.
|
|
Take VERY great care not to omit it! Also be careful to use NullS
|
|
and NOT to use 0, as on some machines 0 is not the same size as a
|
|
character pointer, or not the same bit pattern as NullS.
|
|
|
|
Note: strxnmov is like strnmov in that it moves up to len
|
|
characters; dst will be padded on the right with one NUL characters if
|
|
needed.
|
|
*/
|
|
|
|
#include <global.h>
|
|
#include "m_string.h"
|
|
#include <stdarg.h>
|
|
|
|
char *strxnmov(char *dst,uint len, const char *src, ...)
|
|
{
|
|
va_list pvar;
|
|
char *end_of_dst=dst+len;
|
|
|
|
va_start(pvar,src);
|
|
while (src != NullS)
|
|
{
|
|
do
|
|
{
|
|
if (dst == end_of_dst)
|
|
goto end;
|
|
}
|
|
while ((*dst++ = *src++));
|
|
dst--;
|
|
src = va_arg(pvar, char *);
|
|
}
|
|
*dst=0;
|
|
end:
|
|
va_end(pvar);
|
|
return dst;
|
|
}
|