summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-12-05 03:40:33 +0200
committermonty@mashka.mysql.fi <>2002-12-05 03:40:33 +0200
commitfc06433a69113a914b58f5bb78b98b39f3dce4b8 (patch)
treeacbe11728f20cce01476a8928088773d8016fe76 /strings
parent7d41cd44c69fd23f49de52d6e436d3f821a68ca3 (diff)
downloadmariadb-git-fc06433a69113a914b58f5bb78b98b39f3dce4b8.tar.gz
Removed copying of parameters as this leads to memory leaks in embedded server.
Fixed 'not initialized' memory error.
Diffstat (limited to 'strings')
-rw-r--r--strings/strto.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/strings/strto.c b/strings/strto.c
index 84dccbcbeb8..c98b19a7e67 100644
--- a/strings/strto.c
+++ b/strings/strto.c
@@ -103,6 +103,7 @@ function (const char *nptr,char **endptr,int base)
}
/* Check for a sign. */
+ negative= 0;
if (*s == '-')
{
negative = 1;
@@ -110,11 +111,9 @@ function (const char *nptr,char **endptr,int base)
}
else if (*s == '+')
{
- negative = 0;
++s;
}
- else
- negative = 0;
+
if (base == 16 && s[0] == '0' && toupper (s[1]) == 'X')
s += 2;