/* ----------------------------------------------------------------------
* SFTP packet construction functions.
*/
/* ----------------------------------------------------------------------
* SFTP packet construction functions.
*/
sftp_pkt_adduint32(pkt, 0);
pkt->savedpos = pkt->length;
}
sftp_pkt_adduint32(pkt, 0);
pkt->savedpos = pkt->length;
}
sftp_pkt_addstring_start(pkt);
sftp_pkt_addstring_str(pkt, data);
}
sftp_pkt_addstring_start(pkt);
sftp_pkt_addstring_str(pkt, data);
}
- return 0; /* arrgh, no way to decline (FIXME?) */
- value = GET_32BIT(pkt->data+pkt->savedpos);
+ return 0; /* arrgh, no way to decline (FIXME?) */
+ value = GET_32BIT(pkt->data + pkt->savedpos);
sfree(pkt);
}
/* ----------------------------------------------------------------------
* Send and receive packet functions.
*/
sfree(pkt);
}
/* ----------------------------------------------------------------------
* Send and receive packet functions.
*/
- ret = (sftp_senddata(x, 4) &&
- sftp_senddata(pkt->data, pkt->length));
+ ret = (sftp_senddata(x, 4) && sftp_senddata(pkt->data, pkt->length));
-static char *mkstr(char *s, int len) {
- char *p = smalloc(len+1);
+static char *mkstr(char *s, int len)
+{
+ char *p = smalloc(len + 1);
* SSH_FX_OK, 0 if SSH_FX_EOF, and -1 for anything else (error).
* Also place the status into fxp_errtype.
*/
* SSH_FX_OK, 0 if SSH_FX_EOF, and -1 for anything else (error).
* Also place the status into fxp_errtype.
*/
static const char *const messages[] = {
/* SSH_FX_OK. The only time we will display a _message_ for this
* is if we were expecting something other than FXP_STATUS on
static const char *const messages[] = {
/* SSH_FX_OK. The only time we will display a _message_ for this
* is if we were expecting something other than FXP_STATUS on
* will return 0 on EOF, or return -1 and store SSH_FX_EOF in the
* error indicator. It might even depend on the SFTP server.)
*/
* will return 0 on EOF, or return -1 and store SSH_FX_EOF in the
* error indicator. It might even depend on the SFTP server.)
*/
-int fxp_read(struct fxp_handle *handle, char *buffer, uint64 offset, int len) {
+int fxp_read(struct fxp_handle *handle, char *buffer, uint64 offset,
+ int len)
+{
-int fxp_write(struct fxp_handle *handle, char *buffer, uint64 offset, int len) {
+int fxp_write(struct fxp_handle *handle, char *buffer, uint64 offset,
+ int len)
+{