View | Details | Raw Unified | Return to bug 24707 | Differences between
and this patch

Collapse All | Expand All

(-)whois.c (-6 / +13 lines)
Lines 49-54 Link Here
49
#include <sys/socket.h>
49
#include <sys/socket.h>
50
#include <netinet/in.h>
50
#include <netinet/in.h>
51
#include <arpa/inet.h>
51
#include <arpa/inet.h>
52
#include <ctype.h>
52
#include <err.h>
53
#include <err.h>
53
#include <netdb.h>
54
#include <netdb.h>
54
#include <stdio.h>
55
#include <stdio.h>
Lines 166-178 Link Here
166
				}
167
				}
167
			}
168
			}
168
			if (j != 0) {
169
			if (j != 0) {
169
				qnichost = (char *) calloc(i - j + 1 +
170
				if (isdigit(*(*argv + j + 1))) {
170
				    strlen(QNICHOST_TAIL), sizeof(char));
171
					(void) asprintf(&qnichost, "%s",
171
				if (!qnichost) {
172
					    ANICHOST);
172
					err(1, "calloc");
173
				} else {
174
					qnichost = (char *) calloc(i - j
175
					    + 1 + strlen(QNICHOST_TAIL),
176
					    sizeof(char));
177
					if (!qnichost) {
178
						err(1, "calloc");
179
					}
180
					strcpy(qnichost, *argv + j + 1);
181
					strcat(qnichost, QNICHOST_TAIL);
173
				}
182
				}
174
				strcpy(qnichost, *argv + j + 1);
175
				strcat(qnichost, QNICHOST_TAIL);
176
183
177
				memset(&hints, 0, sizeof(hints));
184
				memset(&hints, 0, sizeof(hints));
178
				hints.ai_flags = 0;
185
				hints.ai_flags = 0;

Return to bug 24707