summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-11-23 22:58:53 +0200
committerunknown <monty@mysql.com>2005-11-23 22:58:53 +0200
commit039168c2fa724b9ed87ce2f19a7ea20acbd8a1de (patch)
tree8972ae3c8dffff8f3b6f27565d191af346c9ac8d /strings
parentfe245ed8ba1258e1f3920e449338ea92e3a3a96e (diff)
parentf631b361b6119fb73df38602ad58e140848f92d7 (diff)
downloadmariadb-git-039168c2fa724b9ed87ce2f19a7ea20acbd8a1de.tar.gz
Merge mysql.com:/home/my/mysql-5.1
into mysql.com:/home/my/mysql-5.1-TDC mysql-test/r/variables.result: Auto merged mysql-test/t/variables.test: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_federated.cc: Auto merged sql/ha_federated.h: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/key.cc: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/parse_file.cc: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_view.cc: Auto merged sql/structs.h: Auto merged sql/field.cc: Merge with global tree sql/sql_base.cc: Merge with global tree sql/table.cc: Merge with global tree
Diffstat (limited to 'strings')
-rw-r--r--strings/strxnmov.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/strings/strxnmov.c b/strings/strxnmov.c
index 3ef0e57650c..7f5d483061c 100644
--- a/strings/strxnmov.c
+++ b/strings/strxnmov.c
@@ -22,19 +22,17 @@
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).
+ to dst and add a closing NUL character.
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.
+ NOTE
+ strxnmov is like strnmov in that it moves up to len
+ characters; dst will be padded on the right with one '\0' character.
+ if total-string-length >= length then dst[length] will be set to \0
*/
#include <my_global.h>
@@ -58,8 +56,8 @@ char *strxnmov(char *dst,uint len, const char *src, ...)
dst--;
src = va_arg(pvar, char *);
}
- *dst=0;
end:
+ *dst=0;
va_end(pvar);
return dst;
}