summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-29 00:39:55 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-29 00:39:55 +0000
commitbd47226987a76f6fd704d94bcc90d81b1bece205 (patch)
treeb63a33d1cbe8a9c55f5c86fff489474666328a9e /scp.c
parentdf221391e620776789e40af9a885c7c9cd945bd3 (diff)
- stevesk@cvs.openbsd.org 2001/03/28 19:56:23
[scp.c] start to sync scp closer to rcp; ok markus@
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/scp.c b/scp.c
index a3a3d4f6..0e510480 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.62 2001/03/21 12:33:33 markus Exp $");
+RCSID("$OpenBSD: scp.c,v 1.63 2001/03/28 19:56:23 stevesk Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -202,8 +202,6 @@ typedef struct {
char *buf;
} BUF;
-extern int iamremote;
-
BUF *allocbuf(BUF *, int, int);
char *colon(char *);
void lostconn(int);
@@ -220,7 +218,6 @@ int pflag, iamremote, iamrecursive, targetshouldbedirectory;
#define CMDNEEDS 64
char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
-int main(int, char *[]);
int response(void);
void rsource(char *, struct stat *);
void sink(int, char *[]);
@@ -295,7 +292,6 @@ main(argc, argv)
iamremote = 1;
tflag = 1;
break;
- case '?':
default:
usage();
}
@@ -640,7 +636,7 @@ rsource(name, statp)
closedir(dirp);
return;
}
- while ((dp = readdir(dirp))) {
+ while ((dp = readdir(dirp)) != NULL) {
if (dp->d_ino == 0)
continue;
if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
@@ -769,7 +765,7 @@ sink(argc, argv)
if (*cp++ != ' ')
SCREWUP("mode not delimited");
- for (size = 0; *cp >= '0' && *cp <= '9';)
+ for (size = 0; isdigit(*cp);)
size = size * 10 + (*cp++ - '0');
if (*cp++ != ' ')
SCREWUP("size not delimited");
@@ -852,7 +848,7 @@ bad: run_err("%s: %s", np, strerror(errno));
continue;
} else if (j <= 0) {
run_err("%s", j ? strerror(errno) :
- "dropped connection");
+ "dropped connection");
exit(1);
}
amt -= j;
@@ -893,7 +889,7 @@ bad: run_err("%s: %s", np, strerror(errno));
if (chmod(np, omode))
#endif /* HAVE_FCHMOD */
run_err("%s: set mode: %s",
- np, strerror(errno));
+ np, strerror(errno));
} else {
if (!exists && omode != mode)
#ifdef HAVE_FCHMOD
@@ -902,7 +898,7 @@ bad: run_err("%s: %s", np, strerror(errno));
if (chmod(np, omode & ~mask))
#endif /* HAVE_FCHMOD */
run_err("%s: set mode: %s",
- np, strerror(errno));
+ np, strerror(errno));
}
if (close(ofd) == -1) {
wrerr = YES;
@@ -913,7 +909,7 @@ bad: run_err("%s: %s", np, strerror(errno));
setimes = 0;
if (utimes(np, tv) < 0) {
run_err("%s: set times: %s",
- np, strerror(errno));
+ np, strerror(errno));
wrerr = DISPLAYED;
}
}