diff options
Diffstat (limited to 'networking')
-rw-r--r-- | networking/nslookup.c | 2 | ||||
-rw-r--r-- | networking/wget.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/networking/nslookup.c b/networking/nslookup.c index 89a2d64..cc5ff95 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c @@ -82,7 +82,7 @@ static int print_host(const char *hostname, const char *header) while (cur) { sockaddr_to_dotted(cur->ai_addr, str, sizeof(str)); printf("%s %s\nAddress: %s", header, hostname, str); - s[0] = ' '; + str[0] = ' '; if (getnameinfo(cur->ai_addr, cur->ai_addrlen, str+1, sizeof(str)-1, NULL, 0, NI_NAMEREQD)) str[0] = '\0'; puts(str); diff --git a/networking/wget.c b/networking/wget.c index 8850fdf..a4c6289 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -324,8 +324,9 @@ int wget_main(int argc, char **argv) break; /*FALLTHRU*/ default: - chomp(buf); - bb_error_msg_and_die("server returned error %s: %s", s, buf); + /* Show first line only and kill any ESC tricks */ + buf[strcspn(buf, "\n\r\x1b")] = '\0'; + bb_error_msg_and_die("server returned error: %s", buf); } /* @@ -585,6 +586,8 @@ static FILE *open_socket(struct sockaddr_in *s_in) { FILE *fp; + /* glibc 2.4 seems to try seeking on it - ??! */ + /* hopefully it understands what ESPIPE means... */ fp = fdopen(xconnect_tcp_v4(s_in), "r+"); if (fp == NULL) bb_perror_msg_and_die("fdopen"); |