Skip to content
Open
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
9 changes: 8 additions & 1 deletion mysys/my_getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,13 @@ my_bool getopt_compare_strings(register const char *s, register const char *t,

static inline ulonglong eval_num_suffix(char *suffix, int *error)
{
/* Sergei’s patch for MDEV-23893:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove above bit of comment and just leave as a comment on the text below, aligned to the indentation level. Correct the indentation level of if too`.

Reject suffixes longer than one character, like “ab”, “hjh”, etc. */
if (suffix[0] && suffix[1])
{
*error = 1;
return 0ULL;
}
switch (*suffix) {
case '\0':
return 1ULL;
Expand Down Expand Up @@ -1022,7 +1029,7 @@ static longlong eval_num_suffix_ll(char *argument,
*error= 0;
errno= 0;
num= strtoll(argument, &endchar, 10);
if (errno == ERANGE)
if (errno == ERANGE||argument==endchar)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces on either side of ||.

{
my_getopt_error_reporter(ERROR_LEVEL,
"Integer value out of range for int64: '%s'", argument);
Expand Down