if (!pktin) { fxp_internal_error("did not receive a valid SFTP packet\n"); return 0; }
int fxp_write(struct fxp_handle *handle, char *buffer, uint64 offset,	      int len){    struct sftp_packet *pktin, *pktout;    int id;    pktout = sftp_pkt_init(SSH_FXP_WRITE);    sftp_pkt_adduint32(pktout, 0xDCB); /* request id */    sftp_pkt_addstring_start(pktout);    sftp_pkt_addstring_data(pktout, handle->hstring, handle->hlen);    sftp_pkt_adduint64(pktout, offset);    sftp_pkt_addstring_start(pktout);    sftp_pkt_addstring_data(pktout, buffer, len);    sftp_send(pktout);    pktin = sftp_recv();    id = sftp_pkt_getuint32(pktin);    if (id != 0xDCB) {	fxp_internal_error("request ID mismatch\n");	return 0;    }    fxp_got_status(pktin);    return fxp_errtype == SSH_FX_OK;}