From 0cda28f77bcea25a35b2d55ee1bb52c5fdb34f2a Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Sat, 19 Feb 2000 10:10:46 +0000 Subject: - Add libmysql to the tree --- ext/mysql/libmysql/strmake.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ext/mysql/libmysql/strmake.c (limited to 'ext/mysql/libmysql/strmake.c') diff --git a/ext/mysql/libmysql/strmake.c b/ext/mysql/libmysql/strmake.c new file mode 100644 index 0000000000..65792625ae --- /dev/null +++ b/ext/mysql/libmysql/strmake.c @@ -0,0 +1,39 @@ +/* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB + This file is public domain and comes with NO WARRANTY of any kind */ + +/* File : strmake.c + Author : Michael Widenius + Updated: 20 Jul 1984 + Defines: strmake() + + strmake(dst,src,length) moves length characters, or until end, of src to + dst and appends a closing NUL to dst. + strmake() returns pointer to closing null; +*/ + +#include +#include "m_string.h" + +#ifdef BAD_STRING_COMPILER + +char *strmake(char *dst,const char *src,uint length) +{ + reg1 char *res; + + if ((res=memccpy(dst,src,0,length))) + return res-1; + dst[length]=0; + return dst+length; +} + +#define strmake strmake_overlapp /* Use orginal for overlapping str */ +#endif + +char *strmake(register char *dst, register const char *src, uint length) +{ + while (length--) + if (! (*dst++ = *src++)) + return dst-1; + *dst=0; + return dst; +} -- cgit v1.2.1