]> granicus.if.org Git - libevent/commitdiff
Update dns-example.
authorMark Ellzey <socket@gmail.com>
Wed, 17 Jun 2015 15:05:53 +0000 (08:05 -0700)
committerMark Ellzey <socket@gmail.com>
Wed, 17 Jun 2015 15:05:53 +0000 (08:05 -0700)
There's somebody out there who is going to have a compiler from 1986 who will complain. Better to fix c99 now.

sample/dns-example.c

index 67a6ace6fdc5cbceb87c486f1a063964eeed4af3..fb705664aa81098f489ba12fcbe61fa1ce14e34c 100644 (file)
@@ -152,11 +152,14 @@ main(int c, char **v) {
                int servertest;
                const char *resolv_conf;
                const char *ns;
-       } o = { };
+       };
+       struct options o;
        char opt;
        struct event_base *event_base = NULL;
        struct evdns_base *evdns_base = NULL;
 
+       memset(&o, 0, sizeof(o));
+       
        if (c < 2) {
                fprintf(stderr, "syntax: %s [-x] [-v] [-c resolv.conf] [-s ns] hostname\n", v[0]);
                fprintf(stderr, "syntax: %s [-T]\n", v[0]);