}
bool
-parse_window_size(const char *json, int *cols, int *rows) {
+parse_window_size(struct pss_tty *pss, int *cols, int *rows) {
+ char json[pss->len];
+ strncpy(json, pss->buffer + 1, pss->len - 1);
+ json[pss->len-1] = '\0';
+
json_object *obj = json_tokener_parse(json);
struct json_object *o = NULL;
case RESIZE_TERMINAL:
{
int cols, rows;
- if (parse_window_size(pss->buffer + 1, &cols, &rows)) {
+ if (parse_window_size(pss, &cols, &rows)) {
if (pty_resize(proc->pty, cols, rows) < 0) {
lwsl_err("pty_resize: %d (%s)\n", errno, strerror(errno));
}