Fix some compiler warnings.
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 21 Jul 2012 13:50:50 +0000 (15:50 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 21 Jul 2012 13:50:50 +0000 (15:50 +0200)
src/protocol_auth.c
src/tincctl.c

index 175aee0..790d324 100644 (file)
@@ -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);
index f547639..24359ab 100644 (file)
@@ -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;