Merge branch 'master' into lukeh/moonshot
Conflicts: lib/gssapi/krb5/external.c lib/libedit/src/vi.c
This commit is contained in:
@@ -608,11 +608,11 @@ TerminalSpeeds(long *input_speed, long *output_speed)
|
||||
int
|
||||
TerminalWindowSize(long *rows, long *cols)
|
||||
{
|
||||
struct winsize ws;
|
||||
int irows, icols;
|
||||
|
||||
if (get_window_size (STDIN_FILENO, &ws) == 0) {
|
||||
*rows = ws.ws_row;
|
||||
*cols = ws.ws_col;
|
||||
if (get_window_size(STDIN_FILENO, &irows, &icols) == 0) {
|
||||
*rows = irows;
|
||||
*cols = icols;
|
||||
return 1;
|
||||
} else
|
||||
return 0;
|
||||
|
@@ -237,12 +237,16 @@ http_query(const char *host, const char *page,
|
||||
in_ptr -= 2;
|
||||
break;
|
||||
} else if (state == RESPONSE) {
|
||||
req->response = strndup(in_buf, p - in_buf);
|
||||
req->response = emalloc(p - in_buf + 1);
|
||||
memcpy(req->response, in_buf, p - in_buf);
|
||||
req->response[p - in_buf] = '\0';
|
||||
state = HEADER;
|
||||
} else {
|
||||
req->headers = realloc(req->headers,
|
||||
(req->num_headers + 1) * sizeof(req->headers[0]));
|
||||
req->headers[req->num_headers] = strndup(in_buf, p - in_buf);
|
||||
req->headers[req->num_headers] = emalloc(p - in_buf + 1);
|
||||
memcpy(req->headers[req->num_headers], in_buf, p - in_buf);
|
||||
req->headers[req->num_headers][p - in_buf] = '\0';
|
||||
if (req->headers[req->num_headers] == NULL)
|
||||
errx(1, "strdup");
|
||||
req->num_headers++;
|
||||
|
Reference in New Issue
Block a user