summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-utf8.c8
-rw-r--r--strings/decimal.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index c439b6023fb..b96ca0e5bbe 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -4340,6 +4340,10 @@ static const char filename_safe_char[128]=
#define MY_FILENAME_ESCAPE '@'
+/*
+ note, that we cannot trust 'e' here, it's may be fake,
+ see strconvert()
+*/
static int
my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
@@ -4361,7 +4365,7 @@ my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)),
return MY_CS_TOOSMALL3;
byte1= s[1];
- byte2= s[2];
+ byte2= byte1 ? s[2] : 0;
if (byte1 >= 0x30 && byte1 <= 0x7F &&
byte2 >= 0x30 && byte2 <= 0x7F)
@@ -4386,7 +4390,7 @@ my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)),
(byte2= hexlo(byte2)) >= 0)
{
int byte3= hexlo(s[3]);
- int byte4= hexlo(s[4]);
+ int byte4= hexlo(s[3] ? s[4] : 0);
if (byte3 >=0 && byte4 >=0)
{
*pwc= (byte1 << 12) + (byte2 << 8) + (byte3 << 4) + byte4;
diff --git a/strings/decimal.c b/strings/decimal.c
index edcb4c52354..edff4c02885 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -669,7 +669,7 @@ int decimal_shift(decimal_t *dec, int shift)
if (do_left)
{
do_mini_left_shift(dec, l_mini_shift, beg, end);
- mini_shift=- l_mini_shift;
+ mini_shift= -l_mini_shift;
}
else
{