summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2003-01-17 13:17:22 +0400
committerunknown <bar@bar.mysql.r18.ru>2003-01-17 13:17:22 +0400
commita93910477ac1ba89021e7007696ea0daccaabc16 (patch)
treec2869adcd2d134689c3e74ff2b56e509404e6a8d /strings
parent8c46b4f5240246de92c87bc9c6f28f79e2e1e5ad (diff)
downloadmariadb-git-a93910477ac1ba89021e7007696ea0daccaabc16.tar.gz
Use always base "10" to remove base guesser in strntoul() implementation
strings/ctype-simple.c: Hide unused code strings/ctype-utf8.c: Hide unused code
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-simple.c30
-rw-r--r--strings/ctype-utf8.c20
-rw-r--r--strings/ctype.c2
3 files changed, 42 insertions, 10 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index df1609c983d..4ecd3717ca1 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -213,10 +213,12 @@ long my_strntol_8bit(CHARSET_INFO *cs,
register unsigned char c;
const char *save, *e;
int overflow;
-
+
+#if 0
if (base < 0 || base == 1 || base > 36)
base = 10;
-
+#endif
+
s = nptr;
e = nptr+l;
@@ -241,9 +243,12 @@ long my_strntol_8bit(CHARSET_INFO *cs,
else
negative = 0;
+#if 0
if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
s += 2;
+#endif
+#if 0
if (base == 0)
{
if (*s == '0')
@@ -259,6 +264,7 @@ long my_strntol_8bit(CHARSET_INFO *cs,
else
base = 10;
}
+#endif
save = s;
cutoff = ((ulong)~0L) / (unsigned long int) base;
@@ -330,9 +336,11 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
const char *save, *e;
int overflow;
+#if 0
if (base < 0 || base == 1 || base > 36)
base = 10;
-
+#endif
+
s = nptr;
e = nptr+l;
@@ -356,9 +364,12 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
else
negative = 0;
+#if 0
if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
s += 2;
+#endif
+#if 0
if (base == 0)
{
if (*s == '0')
@@ -374,6 +385,7 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
else
base = 10;
}
+#endif
save = s;
cutoff = ((ulong)~0L) / (unsigned long int) base;
@@ -437,8 +449,10 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *save;
int overflow;
+#if 0
if (base < 0 || base == 1 || base > 36)
base = 10;
+#endif
s = nptr;
e = nptr+l;
@@ -463,9 +477,12 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
else
negative = 0;
+#if 0
if (base == 16 && s[0] == '0' && (s[1]=='X'|| s[1]=='x'))
s += 2;
+#endif
+#if 0
if (base == 0)
{
if (*s == '0')
@@ -481,6 +498,7 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
else
base = 10;
}
+#endif
save = s;
@@ -553,8 +571,10 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
const char *save;
int overflow;
+#if 0
if (base < 0 || base == 1 || base > 36)
base = 10;
+#endif
s = nptr;
e = nptr+l;
@@ -579,9 +599,12 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
else
negative = 0;
+#if 0
if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
s += 2;
+#endif
+#if 0
if (base == 0)
{
if (*s == '0')
@@ -597,6 +620,7 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
else
base = 10;
}
+#endif
save = s;
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 4a99d7465a7..2418a6ab574 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -2486,9 +2486,11 @@ long my_strntol_ucs2(CHARSET_INFO *cs,
} while (1);
bs:
-
+
+#if 0
if (base <= 0 || base == 1 || base > 36)
base = 10;
+#endif
overflow = 0;
res = 0;
@@ -2597,10 +2599,12 @@ ulong my_strntoul_ucs2(CHARSET_INFO *cs,
} while (1);
bs:
-
+
+#if 0
if (base <= 0 || base == 1 || base > 36)
base = 10;
-
+#endif
+
overflow = 0;
res = 0;
save = s;
@@ -2702,10 +2706,12 @@ longlong my_strntoll_ucs2(CHARSET_INFO *cs,
} while (1);
bs:
-
+
+#if 0
if (base <= 0 || base == 1 || base > 36)
base = 10;
-
+#endif
+
overflow = 0;
res = 0;
save = s;
@@ -2816,9 +2822,11 @@ ulonglong my_strntoull_ucs2(CHARSET_INFO *cs,
bs:
+#if 0
if (base <= 0 || base == 1 || base > 36)
base = 10;
-
+#endif
+
overflow = 0;
res = 0;
save = s;
diff --git a/strings/ctype.c b/strings/ctype.c
index 615f0b7ef49..04ae5917da2 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -4066,7 +4066,7 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, uint len)
switch (state) {
case _CS_ID:
- i->cs.number= my_strntoul(my_charset_latin1,attr,len,0,(char**)NULL,&err);
+ i->cs.number= my_strntoul(my_charset_latin1,attr,len,10,(char**)NULL,&err);
break;
case _CS_COLNAME:
i->cs.name=mstr(i->name,attr,len,MY_CS_NAME_SIZE-1);