summaryrefslogtreecommitdiff
path: root/sql/mini_client.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-02-19 22:04:31 +0200
committerunknown <monty@mysql.com>2004-02-19 22:04:31 +0200
commit68242939d818cf5d091d5dcf13e312994f423f9f (patch)
treeee35dca9ef62332db78569be7002fc980ec60ea7 /sql/mini_client.cc
parenta01a3dd5ef15be9bd6b5b087491d3e676e88c29c (diff)
downloadmariadb-git-68242939d818cf5d091d5dcf13e312994f423f9f.tar.gz
Fixed usage of strxnmov() in recent changesets
libmysql/libmysql.c: szPipeName -> pipe_name fixed usage of strxnmov() mysys/mf_tempfile.c: Fixed usage of strnxmov() Simple optimization mysys/my_tempnam.c: Fixed usage of strnxmov() Simple optimization sql/log.cc: simple optimization sql/mini_client.cc: szPipeName -> pipe_name fixed usage of strxnmov() sql/mysqld.cc: szPipeName -> pipe_name fixed usage of strxnmov() Fixed indentation
Diffstat (limited to 'sql/mini_client.cc')
-rw-r--r--sql/mini_client.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index abe51564c98..86d50dc9a0e 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -117,7 +117,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
char **arg_unix_socket)
{
HANDLE hPipe=INVALID_HANDLE_VALUE;
- char szPipeName [512];
+ char pipe_name[512];
DWORD dwMode;
int i;
my_bool testing_named_pipes=0;
@@ -126,14 +126,15 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
if (!host || !strcmp(host,LOCAL_HOST))
host=LOCAL_HOST_NAMEDPIPE;
- strxnmov(szPipeName, sizeof(szPipeName), "\\\\", host, "\\pipe\\",
- unix_socket, NullS);
+ pipe_name[sizeof(pipe_name)-1]= 0; /* Safety if too long string */
+ strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\", host, "\\pipe\\",
+ unix_socket, NullS);
DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s",
host, unix_socket));
for (i=0 ; i < 100 ; i++) /* Don't retry forever */
{
- if ((hPipe = CreateFile(szPipeName,
+ if ((hPipe = CreateFile(pipe_name,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
@@ -149,7 +150,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
return INVALID_HANDLE_VALUE;
}
/* wait for for an other instance */
- if (! WaitNamedPipe(szPipeName, connect_timeout*1000) )
+ if (! WaitNamedPipe(pipe_name, connect_timeout*1000) )
{
net->last_errno=CR_NAMEDPIPEWAIT_ERROR;
sprintf(net->last_error,ER(net->last_errno),host, unix_socket,