aboutsummaryrefslogtreecommitdiff
path: root/networking/ipcalc.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/ipcalc.c')
-rw-r--r--networking/ipcalc.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/networking/ipcalc.c b/networking/ipcalc.c
index 909373cbb..0ee9646c2 100644
--- a/networking/ipcalc.c
+++ b/networking/ipcalc.c
@@ -64,19 +64,18 @@ int get_prefix(unsigned long netmask);
64 64
65#if ENABLE_FEATURE_IPCALC_LONG_OPTIONS 65#if ENABLE_FEATURE_IPCALC_LONG_OPTIONS
66 static const struct option long_options[] = { 66 static const struct option long_options[] = {
67 {"netmask", no_argument, NULL, 'm'}, 67 { "netmask", no_argument, NULL, 'm' },
68 {"broadcast", no_argument, NULL, 'b'}, 68 { "broadcast", no_argument, NULL, 'b' },
69 {"network", no_argument, NULL, 'n'}, 69 { "network", no_argument, NULL, 'n' },
70#ifdef CONFIG_FEATURE_IPCALC_FANCY 70# if ENABLE_FEATURE_IPCALC_FANCY
71 {"prefix", no_argument, NULL, 'p'}, 71 { "prefix", no_argument, NULL, 'p' },
72 {"hostname", no_argument, NULL, 'h'}, 72 { "hostname", no_argument, NULL, 'h' },
73 {"silent", no_argument, NULL, 's'}, 73 { "silent", no_argument, NULL, 's' },
74#endif 74# endif
75 {NULL, 0, NULL, 0} 75 { NULL, 0, NULL, 0 }
76 }; 76 };
77#else
78#define long_options 0
79#endif 77#endif
78
80int ipcalc_main(int argc, char **argv) 79int ipcalc_main(int argc, char **argv)
81{ 80{
82 unsigned opt; 81 unsigned opt;
@@ -85,9 +84,9 @@ int ipcalc_main(int argc, char **argv)
85 struct in_addr a; 84 struct in_addr a;
86 char *ipstr; 85 char *ipstr;
87 86
88 if (ENABLE_FEATURE_IPCALC_LONG_OPTIONS) 87#if ENABLE_FEATURE_IPCALC_LONG_OPTIONS
89 applet_long_options = long_options; 88 applet_long_options = long_options;
90 89#endif
91 opt = getopt32(argc, argv, "mbn" USE_FEATURE_IPCALC_FANCY("phs")); 90 opt = getopt32(argc, argv, "mbn" USE_FEATURE_IPCALC_FANCY("phs"));
92 argc -= optind; 91 argc -= optind;
93 argv += optind; 92 argv += optind;