MCPcopy Create free account
hub / github.com/MariaDB/server / get_string_parameter

Function get_string_parameter

sql/sql_repl.cc:4377–4393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4375*/
4376
4377static bool get_string_parameter(char *to, const char *from, size_t length,
4378 const char *name, CHARSET_INFO *cs)
4379{
4380 if (from) // Empty paramaters allowed
4381 {
4382 size_t from_length= strlen(from);
4383 size_t from_numchars= cs->numchars(from, from + from_length);
4384 if (from_numchars > length / cs->mbmaxlen)
4385 {
4386 my_error(ER_WRONG_STRING_LENGTH, MYF(0), from, name,
4387 (int) (length / cs->mbmaxlen));
4388 return 1;
4389 }
4390 memcpy(to, from, from_length+1);
4391 }
4392 return 0;
4393}
4394
4395
4396/**

Callers 1

change_masterFunction · 0.85

Calls 2

my_errorFunction · 0.85
numcharsMethod · 0.45

Tested by

no test coverage detected