]> git.meshlink.io Git - meshlink/commitdiff
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 175aee0f28187291e23db4e330deff66a8efbafe..790d324d0b054457a9d2e42f848d141dc3cf43fe 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 f547639a8460232443b2a2baf8689b8148b5d823..24359ab7cc2d467ea3f97137c449ef7760cb7fe6 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;