Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions extra/comp_err.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ static uint parse_input_file(const char *file_name, struct errors **top_error,

static uint parse_error_offset(char *str)
{
char *soffset, *end;
char *soffset;
int error;
uint ioffset;

Expand Down Expand Up @@ -651,8 +651,7 @@ static uint parse_error_offset(char *str)
}
DBUG_PRINT("info", ("str: %s", str));

end= 0;
ioffset= (uint) my_strtoll10(soffset, &end, &error);
ioffset= (uint) my_strtoll10(soffset, NULL, &error);
my_free(soffset);
DBUG_RETURN(ioffset);
}
Expand Down
15 changes: 12 additions & 3 deletions include/m_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,22 @@
extern "C" {
#endif

#ifdef DBUG_OFF
#if defined(HAVE_STPCPY) && defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define strmov(A,B) __builtin_stpcpy((A),(B))
#elif defined(HAVE_STPCPY)
#define strmov(A,B) stpcpy((A),(B))
#endif
#endif
#else
static inline char *strmov(char *dst, const char *src) __attribute__((nonnull(1,2)))
{
size_t l;
DBUG_ASSERT(dst != NULL);
DBUG_ASSERT(src != NULL);

l= strlen(src);
memmove(dst, src, l + 1);
return dst + l;
}
#endif /* strmov */

/* Declared in int2str() */
extern const char _dig_vec_upper[];
Expand Down
2 changes: 1 addition & 1 deletion strings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c dtoa.c int2str.c
ctype-unidata.c
is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c
str2int.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
str2int.c strcend.c strend.c strfill.c strmake.c strnmov.c
strxmov.c strxnmov.c xml.c
strmov_overlapp.c
my_strchr.c strcont.c strappend.c json_lib.c json_normalize.c)
Expand Down
48 changes: 0 additions & 48 deletions strings/strmov.c

This file was deleted.

18 changes: 13 additions & 5 deletions strings/uca-dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,20 @@ static int process_option(OPT *options, const char *opt)
static const LEX_CSTRING opt_levels= {STRING_WITH_LEN("--levels=")};
static const LEX_CSTRING opt_no_contractions= {STRING_WITH_LEN("--no-contractions")};
static const LEX_CSTRING opt_case_first= {STRING_WITH_LEN("--case-first=")};
const char *eq = strchr(opt, '=');
if (!lstrncmp(opt, opt_name_prefix))
{
options->name_prefix= opt + opt_name_prefix.length;
if (!eq)
return 1;

options->name_prefix = eq + 1;
return 0;
}
if (!lstrncmp(opt, opt_levels))
{
options->levels= (uint) strtoul(opt + opt_levels.length, NULL, 10);
if (!eq)
return 1;
options->levels= (uint) strtoul(eq + 1, NULL, 10);
if (options->levels < 1 || options->levels > 3)
{
printf("Bad --levels value\n");
Expand All @@ -434,13 +440,15 @@ static int process_option(OPT *options, const char *opt)
}
if (!lstrncmp(opt, opt_case_first))
{
const char *value= opt + opt_case_first.length;
if (!strcasecmp(value, "upper"))
if (!eq)
return 1;
eq++;
if (!strcasecmp(eq, "upper"))
{
options->case_first_upper= TRUE;
return 0;
}
if (!strcasecmp(value, "lower"))
if (!strcasecmp(eq, "lower"))
{
options->case_first_upper= FALSE;
return 0;
Expand Down