diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-09-12 12:14:14 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-09-12 12:50:52 -0700 |
| commit | 5f73996bf368e7f5d7249679c738a87873cb340d (patch) | |
| tree | d73413a4f8c0f4a07fd6a6a5a08a8d6bfae41851 /tools | |
| parent | 74b067f6c381567e3da89e8a95ca13b4ffe81302 (diff) | |
| download | nng-5f73996bf368e7f5d7249679c738a87873cb340d.tar.gz nng-5f73996bf368e7f5d7249679c738a87873cb340d.tar.bz2 nng-5f73996bf368e7f5d7249679c738a87873cb340d.zip | |
fixes #720 fix for #715 still not right
The fix for #715 to address const is still not quite right.
In ISO C, the argv array is just char **. getopt() in POSIX uses
char *const[]. That part is right, but we should then not pass
const char ** in calls. Furthermore, really the optarg should also
not be constified.
This aligns us closer to getopt() and leads to the fewest problems.
This does represent a slight breaking change, but as old code should
still compile and run, we don't think we should bump the API version
for this change. Furthermore, we don't think anyone else is actually
using this API yet.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/nngcat/nngcat.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/nngcat/nngcat.c b/tools/nngcat/nngcat.c index 132599e4..e81f59c0 100644 --- a/tools/nngcat/nngcat.c +++ b/tools/nngcat/nngcat.c @@ -200,7 +200,9 @@ static nng_optspec opts[] = { .o_arg = true, }, { - .o_name = "zt-home", .o_val = OPT_ZTHOME, .o_arg = true, + .o_name = "zt-home", + .o_val = OPT_ZTHOME, + .o_arg = true, }, { .o_name = "version", .o_short = 'V', .o_val = OPT_VERSION }, @@ -671,10 +673,10 @@ sendrecv(nng_socket sock) } int -main(int ac, const char **av) +main(int ac, char **av) { int idx; - const char * arg; + char * arg; int val; int rv; char scratch[512]; |
