Do not print error message for errno when showing the usage string. Use the same usage string in the two places where the usage is printed.

This commit is contained in:
nvt-se 2009-11-03 14:00:28 +00:00
parent 2662c87d60
commit 9b801b59c7

View File

@ -29,7 +29,7 @@
* *
* This file is part of the uIP TCP/IP stack. * This file is part of the uIP TCP/IP stack.
* *
* $Id: tapslip6.c,v 1.2 2009/11/02 11:46:49 adamdunkels Exp $ * $Id: tapslip6.c,v 1.3 2009/11/03 14:00:28 nvt-se Exp $
* *
*/ */
@ -64,6 +64,8 @@ void write_to_serial(int outfd, void *inbuf, int len);
//#define PROGRESS(s) fprintf(stderr, s) //#define PROGRESS(s) fprintf(stderr, s)
#define PROGRESS(s) do { } while (0) #define PROGRESS(s) do { } while (0)
#define USAGE_STRING "usage: tapslip6 [-B baudrate] [-s siodev] [-t tundev] ipaddress netmask"
char tundev[32] = { "tap0" }; char tundev[32] = { "tap0" };
int int
@ -512,7 +514,7 @@ main(int argc, char **argv)
case '?': case '?':
case 'h': case 'h':
default: default:
err(1, "usage: tapslip6 [-B baudrate] [-s siodev] [-t tundev] ipaddress netmask"); errx(1, USAGE_STRING);
break; break;
} }
} }
@ -520,7 +522,7 @@ main(int argc, char **argv)
argv += (optind - 1); argv += (optind - 1);
if(argc != 3 && argc != 4) { if(argc != 3 && argc != 4) {
err(1, "usage: tapslip6 [-s siodev] [-t tundev] ipaddress netmask "); errx(1, USAGE_STRING);
} }
ipaddr = argv[1]; ipaddr = argv[1];
netmask = argv[2]; netmask = argv[2];