summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-04-14 23:14:22 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-04-14 23:14:22 +0000
commitf719a2011060639cfe6292349cb8c040b3c7352b (patch)
tree24582e679359c497fcd73c3e62abbe8c3bcc87b0
parentae8e2d30db561a556ee0a82dce0dcda3d6f82623 (diff)
- stevesk@cvs.openbsd.org 2001/04/14 17:04:42
[scp.c] 'T' handling rcp/scp sync; ok markus@
-rw-r--r--ChangeLog5
-rw-r--r--scp.c25
2 files changed, 15 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 53dd06de..05b8fc2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@
- stevesk@cvs.openbsd.org 2001/04/14 16:33:20
[clientloop.c packet.h session.c ssh.c ttymodes.c ttymodes.h]
protocol 2 tty modes support; ok markus@
+ - stevesk@cvs.openbsd.org 2001/04/14 17:04:42
+ [scp.c]
+ 'T' handling rcp/scp sync; ok markus@
20010414
- Sync with OpenBSD glob.c, strlcat.c and vis.c changes
@@ -5078,4 +5081,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.1114 2001/04/14 23:13:02 mouring Exp $
+$Id: ChangeLog,v 1.1115 2001/04/14 23:14:22 mouring Exp $
diff --git a/scp.c b/scp.c
index c654cb66..ef8ed9f2 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.65 2001/04/06 16:46:59 deraadt Exp $");
+RCSID("$OpenBSD: scp.c,v 1.66 2001/04/14 17:04:42 stevesk Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -677,9 +677,10 @@ sink(argc, argv)
off_t size;
int setimes, targisdir, wrerrno = 0;
char ch, *cp, *np, *targ, *why, *vect[1], buf[2048];
- int dummy_usec;
struct timeval tv[2];
+#define atime tv[0]
+#define mtime tv[1]
#define SCREWUP(str) { why = str; goto screwup; }
setimes = targisdir = 0;
@@ -726,25 +727,21 @@ sink(argc, argv)
if (ch == '\n')
*--cp = 0;
-#define getnum(t) (t) = 0; \
- while (*cp >= '0' && *cp <= '9') (t) = (t) * 10 + (*cp++ - '0');
cp = buf;
if (*cp == 'T') {
setimes++;
cp++;
- getnum(tv[1].tv_sec);
- if (*cp++ != ' ')
+ mtime.tv_sec = strtol(cp, &cp, 10);
+ if (!cp || *cp++ != ' ')
SCREWUP("mtime.sec not delimited");
- getnum(dummy_usec);
- tv[1].tv_usec = 0;
- if (*cp++ != ' ')
+ mtime.tv_usec = strtol(cp, &cp, 10);
+ if (!cp || *cp++ != ' ')
SCREWUP("mtime.usec not delimited");
- getnum(tv[0].tv_sec);
- if (*cp++ != ' ')
+ atime.tv_sec = strtol(cp, &cp, 10);
+ if (!cp || *cp++ != ' ')
SCREWUP("atime.sec not delimited");
- getnum(dummy_usec);
- tv[0].tv_usec = 0;
- if (*cp++ != '\0')
+ atime.tv_usec = strtol(cp, &cp, 10);
+ if (!cp || *cp++ != '\0')
SCREWUP("atime.usec not delimited");
(void) atomicio(write, remout, "", 1);
continue;