From 7303b512b0e4f0d9cbc3236e846b2618f527b830 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 21 Jul 2012 15:50:50 +0200 Subject: [PATCH] Fix some compiler warnings. --- src/protocol_auth.c | 2 +- src/tincctl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 175aee0f..790d324d 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -65,7 +65,7 @@ static bool send_proxyrequest(connection_t *c) { memcpy(s4req + 2, &c->address.in.sin_port, 2); memcpy(s4req + 4, &c->address.in.sin_addr, 4); if(proxyuser) - strcpy(s4req + 8, proxyuser); + memcpy(s4req + 8, proxyuser, strlen(proxyuser)); s4req[sizeof s4req - 1] = 0; c->tcplen = 8; return send_meta(c, s4req, sizeof s4req); diff --git a/src/tincctl.c b/src/tincctl.c index f547639a..24359ab7 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -1194,7 +1194,7 @@ static int cmd_config(int argc, char *argv[]) { while(fgets(buf1, sizeof buf1, f)) { buf1[sizeof buf1 - 1] = 0; - strcpy(buf2, buf1); + strncpy(buf2, buf1, sizeof buf2); // Parse line in a simple way char *bvalue; -- 2.39.5