i = 0;
i = ret = 0;
int read_dupsession_data(struct gui_data *inst, Config *cfg, char *arg){    int fd, i, ret, size;    char *data;    if (sscanf(arg, "---[%d,%d]", &fd, &size) != 2) {	fprintf(stderr, "%s: malformed magic argument `%s'\n", appname, arg);	exit(1);    }    data = snewn(size, char);    i = 0;    while (i < size && (ret = read(fd, data + i, size - i)) > 0)	i += ret;    if (ret < 0) {	perror("read from pipe");	exit(1);    } else if (i < size) {	fprintf(stderr, "%s: unexpected EOF in Duplicate Session data\n",		appname);	exit(1);    }    memcpy(cfg, data, sizeof(Config));    if (use_pty_argv && size > sizeof(Config)) {	int n = 0;	i = sizeof(Config);	while (i < size) {	    while (i < size && data[i]) i++;	    if (i >= size) {		fprintf(stderr, "%s: malformed Duplicate Session data\n",			appname);		exit(1);	    }	    i++;	    n++;	}	pty_argv = snewn(n+1, char *);	pty_argv[n] = NULL;	n = 0;	i = sizeof(Config);	while (i < size) {	    char *p = data + i;	    while (i < size && data[i]) i++;	    assert(i < size);	    i++;	    pty_argv[n++] = dupstr(p);	}    }    return 0;}