summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorkent@kent-amd64.(none) <>2007-07-21 01:53:19 +0200
committerkent@kent-amd64.(none) <>2007-07-21 01:53:19 +0200
commit9d247f296a8086f6379a32cece568ada279f9f8c (patch)
tree0b56ddbf67df3ed64d453b4f68cc0e931ca79549 /mysys
parent1a86cbd26f5d76f5fc61aa944b6bf5e52c81e615 (diff)
parente50e8c94fc697f06349025553f8d8b26cf66a442 (diff)
downloadmariadb-git-9d247f296a8086f6379a32cece568ada279f9f8c.tar.gz
Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/kent/bk/tmp3/mysql-5.0-build
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_conio.c7
-rw-r--r--mysys/my_symlink2.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/mysys/my_conio.c b/mysys/my_conio.c
index 23b0c55e7a9..def15674f26 100644
--- a/mysys/my_conio.c
+++ b/mysys/my_conio.c
@@ -184,16 +184,19 @@ char* my_cgets(char *buffer, unsigned long clen, unsigned long* plen)
}
while (GetLastError() == ERROR_NOT_ENOUGH_MEMORY);
+ /* We go here on error reading the string (Ctrl-C for example) */
+ if (!*plen)
+ result= NULL; /* purecov: inspected */
if (result != NULL)
{
- if (buffer[*plen - 2] == '\r')
+ if (*plen > 1 && buffer[*plen - 2] == '\r')
{
*plen= *plen - 2;
}
else
{
- if (buffer[*plen - 1] == '\r')
+ if (*plen > 0 && buffer[*plen - 1] == '\r')
{
char tmp[3];
int tmplen= sizeof(tmp);
diff --git a/mysys/my_symlink2.c b/mysys/my_symlink2.c
index 2ad08ef67de..e2493874097 100644
--- a/mysys/my_symlink2.c
+++ b/mysys/my_symlink2.c
@@ -52,11 +52,13 @@ File my_create_with_symlink(const char *linkname, const char *filename,
{
if (!access(filename,F_OK))
{
+ my_errno= errno= EEXIST;
my_error(EE_CANTCREATEFILE, MYF(0), filename, EEXIST);
DBUG_RETURN(-1);
}
if (create_link && !access(linkname,F_OK))
{
+ my_errno= errno= EEXIST;
my_error(EE_CANTCREATEFILE, MYF(0), linkname, EEXIST);
DBUG_RETURN(-1);
}