if (pendsize < pendlen + len) {
pendsize = pendlen + len + 4096;
pending = sresize(pending, pendsize, unsigned char);
- if (!pending)
- fatalbox("Out of memory");
}
memcpy(pending + pendlen, p, len);
pendlen += len;
static struct fxp_xfer *scp_sftp_xfer;
static uint64 scp_sftp_fileoffset;
-void scp_source_setup(char *target, int shouldbedir)
+int scp_source_setup(char *target, int shouldbedir)
{
if (using_sftp) {
/*
if (!fxp_init()) {
tell_user(stderr, "unable to initialise SFTP: %s", fxp_error());
errs++;
- return;
+ return 1;
}
sftp_register(req = fxp_stat_send(target));
} else {
(void) response();
}
+ return 0;
}
int scp_send_errmsg(char *str)
do_cmd(host, user, cmd);
sfree(cmd);
- scp_source_setup(targ, targetshouldbedirectory);
+ if (scp_source_setup(targ, targetshouldbedirectory))
+ return;
for (i = 0; i < argc - 1; i++) {
src = argv[i];