summaryrefslogtreecommitdiff
path: root/innobase/ut
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-08-12 04:04:43 +0300
committerunknown <monty@hundin.mysql.fi>2002-08-12 04:04:43 +0300
commit514e60480d77236aedb1ab69c0e7754e060e495a (patch)
tree4ba65b7347df0448111dd1a3ab055bc2c8a1c6dc /innobase/ut
parent9b1930152db6ecd30b8cbcc7200af2baf7f82295 (diff)
parent071994ba3665ce2284de5e77a4f06c0b6e93eeeb (diff)
downloadmariadb-git-514e60480d77236aedb1ab69c0e7754e060e495a.tar.gz
merge with 3.23.52
BitKeeper/deleted/.del-global.h~e80d28157acfdcb5: Auto merged Docs/manual.texi: Auto merged include/my_no_pthread.h: Auto merged innobase/include/univ.i: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/os/os0thread.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/trx/trx0trx.c: Auto merged innobase/ut/ut0ut.c: Auto merged mysql-test/r/bigint.result: Auto merged mysql-test/t/bigint.test: Auto merged mysys/my_init.c: Auto merged mysys/my_net.c: Auto merged mysys/mysys_priv.h: Auto merged mysys/thr_rwlock.c: Auto merged sql/ha_innodb.h: Auto merged sql/sql_insert.cc: Auto merged include/my_sys.h: merge with 3.23 libmysql/Makefile.shared: merge with 3.23 mysql-test/mysql-test-run.sh: merge with 3.23 mysql-test/r/func_if.result: merge with 3.23 mysys/Makefile.am: merge with 3.23 mysys/my_gethostbyname.c: merge with 3.23 sql/ha_innodb.cc: merge with 3.23 sql/item_cmpfunc.cc: merge with 3.23 sql/mysqld.cc: merge with 3.23 sql/sql_show.cc: merge with 3.23
Diffstat (limited to 'innobase/ut')
-rw-r--r--innobase/ut/ut0ut.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c
index c164afa0573..c77cbe9cdcf 100644
--- a/innobase/ut/ut0ut.c
+++ b/innobase/ut/ut0ut.c
@@ -12,11 +12,36 @@ Created 5/11/1994 Heikki Tuuri
#include "ut0ut.ic"
#endif
+#include <stdarg.h>
+
#include "ut0sort.h"
ibool ut_always_false = FALSE;
/************************************************************
+Uses vsprintf to emulate sprintf so that the function always returns
+the printed length. Apparently in some old SCO Unixes sprintf did not
+return the printed length but a pointer to the end of the printed string. */
+
+ulint
+ut_sprintf(
+/*=======*/
+ char* buf, /* in/out: buffer where to print */
+ const char* format, /* in: format of prints */
+ ...) /* in: arguments to be printed */
+{
+ va_list args;
+
+ va_start(args, format);
+
+ vsprintf(buf, format, args);
+
+ va_end(args);
+
+ return((ulint)strlen(buf));
+}
+
+/************************************************************
Gets the high 32 bits in a ulint. That is makes a shift >> 32,
but since there seem to be compiler bugs in both gcc and Visual C++,
we do this by a special conversion. */