From e28341264b57500872f7b793dbbe326452ba3843 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jul 2006 21:03:19 +0200 Subject: [PATCH] Fixing usage of my_strndup() to new prototype. --- sql/ha_federated.cc | 7 +++---- sql/log_event.cc | 7 ++----- sql/set_var.cc | 4 ++-- sql/set_var.h | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 91111a433dc..be923591cac 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -629,10 +629,9 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table, DBUG_PRINT("info", ("Length: %d", table->s->connect_string.length)); DBUG_PRINT("info", ("String: '%.*s'", table->s->connect_string.length, table->s->connect_string.str)); - share->scheme= my_strndup((const byte*)table->s-> - connect_string.str, - table->s->connect_string.length, - MYF(0)); + share->scheme= my_strndup(table->s->connect_string.str, + table->s->connect_string.length, + MYF(0)); // Add a null for later termination of table name share->scheme[table->s->connect_string.length]= 0; diff --git a/sql/log_event.cc b/sql/log_event.cc index 36805e0043d..02bf22429f2 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -3175,8 +3175,7 @@ Rotate_log_event::Rotate_log_event(const char* new_log_ident_arg, llstr(pos_arg, buff), flags)); #endif if (flags & DUP_NAME) - new_log_ident= my_strndup((const byte*) new_log_ident_arg, - ident_len, MYF(MY_WME)); + new_log_ident= my_strndup(new_log_ident_arg, ident_len, MYF(MY_WME)); DBUG_VOID_RETURN; } #endif @@ -3199,9 +3198,7 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len, (header_size+post_header_len)); ident_offset = post_header_len; set_if_smaller(ident_len,FN_REFLEN-1); - new_log_ident= my_strndup((byte*) buf + ident_offset, - (uint) ident_len, - MYF(MY_WME)); + new_log_ident= my_strndup(buf + ident_offset, (uint) ident_len, MYF(MY_WME)); DBUG_VOID_RETURN; } diff --git a/sql/set_var.cc b/sql/set_var.cc index b0ecc7eccef..bb9ef4d453f 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1097,7 +1097,7 @@ bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex, uint new_length= (var ? var->value->str_value.length() : 0); if (!old_value) old_value= (char*) ""; - if (!(res= my_strndup((byte*)old_value, new_length, MYF(0)))) + if (!(res= my_strndup(old_value, new_length, MYF(0)))) return 1; /* Replace the old value in such a way that the any thread using @@ -2632,7 +2632,7 @@ bool update_sys_var_str_path(THD *thd, sys_var_str *var_str, old_value= make_default_log_name(buff, log_ext); str_length= strlen(old_value); } - if (!(res= my_strndup((byte*)old_value, str_length, MYF(MY_FAE+MY_WME)))) + if (!(res= my_strndup(old_value, str_length, MYF(MY_FAE+MY_WME)))) { result= 1; goto err; diff --git a/sql/set_var.h b/sql/set_var.h index d01ce833d14..b968b4c7840 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -1055,7 +1055,7 @@ public: uint name_length_arg, gptr data_arg) :name_length(name_length_arg), data(data_arg) { - name= my_strndup((byte*) name_arg, name_length, MYF(MY_WME)); + name= my_strndup(name_arg, name_length, MYF(MY_WME)); links->push_back(this); } inline bool cmp(const char *name_cmp, uint length)