aboutsummaryrefslogtreecommitdiff
path: root/src/vpn/gnunet-helper-vpn-windows.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-25 21:42:11 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-25 21:42:11 +0000
commit78ad97319349e9881653684f276dd620a0a423e9 (patch)
treecded8f0063f6848429706a36bd51174e62417b7e /src/vpn/gnunet-helper-vpn-windows.c
parentb968c5926b205c3cdd467474753746ef21522b32 (diff)
downloadgnunet-78ad97319349e9881653684f276dd620a0a423e9.tar.gz
gnunet-78ad97319349e9881653684f276dd620a0a423e9.zip
-misc fixes based on cppcheck
Diffstat (limited to 'src/vpn/gnunet-helper-vpn-windows.c')
-rw-r--r--src/vpn/gnunet-helper-vpn-windows.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/vpn/gnunet-helper-vpn-windows.c b/src/vpn/gnunet-helper-vpn-windows.c
index 0d31ee399..15dc5a667 100644
--- a/src/vpn/gnunet-helper-vpn-windows.c
+++ b/src/vpn/gnunet-helper-vpn-windows.c
@@ -357,7 +357,7 @@ remove_address6 (const char *address)
357 */ 357 */
358 snprintf (command, LINE_LEN, 358 snprintf (command, LINE_LEN,
359 "netsh interface ipv6 delete address \"%s\" store=persistent", 359 "netsh interface ipv6 delete address \"%s\" store=persistent",
360 device_visible_name, address); 360 device_visible_name);
361 /* 361 /*
362 * Set the address 362 * Set the address
363 */ 363 */
@@ -365,7 +365,9 @@ remove_address6 (const char *address)
365 365
366 /* Did it work?*/ 366 /* Did it work?*/
367 if (0 != ret) 367 if (0 != ret)
368 fprintf (stderr, "FATAL: removing IPv6 address failed: %s\n", strerror (ret)); 368 fprintf (stderr,
369 "FATAL: removing IPv6 address failed: %s\n",
370 strerror (ret));
369} 371}
370 372
371 373
@@ -408,7 +410,9 @@ set_address4 (const char *address, const char *mask)
408 410
409 /* Did it work?*/ 411 /* Did it work?*/
410 if (0 != ret) 412 if (0 != ret)
411 fprintf (stderr, "FATAL: Setting IPv4 address failed: %s\n", strerror (ret)); 413 fprintf (stderr,
414 "FATAL: Setting IPv4 address failed: %s\n",
415 strerror (ret));
412 return ret; 416 return ret;
413} 417}
414 418
@@ -431,7 +435,7 @@ remove_address4 (const char *address)
431 */ 435 */
432 snprintf (command, LINE_LEN, 436 snprintf (command, LINE_LEN,
433 "netsh interface ipv4 delete address \"%s\" gateway=all store=persistent", 437 "netsh interface ipv4 delete address \"%s\" gateway=all store=persistent",
434 device_visible_name, address); 438 device_visible_name);
435 /* 439 /*
436 * Set the address 440 * Set the address
437 */ 441 */
@@ -1471,14 +1475,18 @@ main (int argc, char **argv)
1471 1475
1472 if (argc > 1 && 0 != strcmp (argv[1], "-d")){ 1476 if (argc > 1 && 0 != strcmp (argv[1], "-d")){
1473 privilege_testing = TRUE; 1477 privilege_testing = TRUE;
1474 fprintf (stderr, "DEBUG: Running binary in privilege testing mode.", argv[0]); 1478 fprintf (stderr,
1479 "%s",
1480 "DEBUG: Running binary in privilege testing mode.");
1475 argv++; 1481 argv++;
1476 argc--; 1482 argc--;
1477 } 1483 }
1478 1484
1479 if (6 != argc) 1485 if (6 != argc)
1480 { 1486 {
1481 fprintf (stderr, "FATAL: must supply 5 arguments\nUsage:\ngnunet-helper-vpn [-d] <if name prefix> <address6 or \"-\"> <netbits6> <address4 or \"-\"> <netmask4>\n", argv[0]); 1487 fprintf (stderr,
1488 "%s",
1489 "FATAL: must supply 5 arguments\nUsage:\ngnunet-helper-vpn [-d] <if name prefix> <address6 or \"-\"> <netbits6> <address4 or \"-\"> <netmask4>\n");
1482 return 1; 1490 return 1;
1483 } 1491 }
1484 1492