1 diff -up jwhois-4.0/src/jwhois.c.orig jwhois-4.0/src/jwhois.c
2 --- jwhois-4.0/src/jwhois.c.orig 2007-06-26 08:59:35.000000000 +0200
3 +++ jwhois-4.0/src/jwhois.c 2011-05-24 12:29:37.398892451 +0200
4 @@ -98,7 +98,7 @@ main(int argc, char **argv)
6 /* Parse remaining arguments and place them into the wq
8 - while (optind < argc)
9 + while (optind < argc-1)
11 count += strlen(argv[optind])+1;
13 @@ -116,19 +116,25 @@ main(int argc, char **argv)
17 - qstring[strlen(qstring)-1] = '\0';
19 - rc = idna_to_ascii_lz(qstring, &idn, 0);
20 + rc = idna_to_ascii_lz(argv[optind], &idn, 0);
21 if (rc != IDNA_SUCCESS)
23 - printf("[IDN encoding of '%s' failed with error code %d]\n", qstring, rc);
24 + printf("[IDN encoding of '%s' failed with error code %d]\n", argv[optind], rc);
27 - wq.query = strdup(idn);
28 + qstring = realloc(qstring, count+strlen(idn)+1);
29 + memcpy(qstring+count,
35 + qstring = realloc(qstring, count+strlen(argv[optind])+1);
36 + memcpy(qstring+count,
38 + strlen(argv[optind])+1);