From 0bfec316ce62bf5f46b55888a0a9d593171c4eb5 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Wed, 17 Oct 2001 19:39:39 +0300 Subject: Don't do signal() on windows (Causes instability problems) Safer, a bit faster filesort. Code changes to avoid calls to current_thd() (faster code). Removed all compiler warnings from readline. --- mysys/my_alloc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mysys/my_alloc.c') diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index fe9431ff57a..5f3bc385c39 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -195,10 +195,17 @@ void set_prealloc_root(MEM_ROOT *root, char *ptr) char *strdup_root(MEM_ROOT *root,const char *str) { - uint len= (uint) strlen(str)+1; + return strmake_root(root, str, strlen(str)); +} + +char *strmake_root(MEM_ROOT *root,const char *str, uint len) +{ char *pos; - if ((pos=alloc_root(root,len))) + if ((pos=alloc_root(root,len+1))) + { memcpy(pos,str,len); + pos[len]=0; + } return pos; } -- cgit v1.2.1