summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-04-17 19:42:34 +0200
committerSergei Golubchik <sergii@pisem.net>2013-04-17 19:42:34 +0200
commit07315d36030bd1cbe6acfeb3e8f60c49ba876a10 (patch)
tree9c74de4bb97507ece945576df7073a7a28f07674 /sql-common
parent4656060f118caba30912cca2557d72fcea307283 (diff)
downloadmariadb-git-07315d36030bd1cbe6acfeb3e8f60c49ba876a10.tar.gz
strmake_buf(X,Y) helper, equivalent to strmake(X,Y,sizeof(X)-1)
with a bit of lame protection against abuse.
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 976c09d7a70..c81fe6a8a69 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -776,7 +776,7 @@ restart:
len-=2;
if (protocol_41(mysql) && (char) pos[0] == '#')
{
- strmake(net->sqlstate, (char*) pos+1, SQLSTATE_LENGTH);
+ strmake_buf(net->sqlstate, (char*) pos+1);
pos+= SQLSTATE_LENGTH+1;
}
else
@@ -3120,7 +3120,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
bzero((char*) &UNIXaddr, sizeof(UNIXaddr));
UNIXaddr.sun_family= AF_UNIX;
- strmake(UNIXaddr.sun_path, unix_socket, sizeof(UNIXaddr.sun_path)-1);
+ strmake_buf(UNIXaddr.sun_path, unix_socket);
if (connect_sync_or_async(mysql, net, sock,
(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr)))
{