diff options
author | Paul Traina <pst@FreeBSD.org> | 1996-02-08 21:06:40 +0000 |
---|---|---|
committer | Paul Traina <pst@FreeBSD.org> | 1996-02-08 21:06:40 +0000 |
commit | a03b5a5efb70aad04635d8594c403706f825b35e (patch) | |
tree | 830bc7ab2e21eb78d0fe7d6bfc3b61865c5d7bd5 /bin | |
parent | a42a667de17fc41502b653fe1683cc1e900db1d5 (diff) | |
download | src-a03b5a5efb70aad04635d8594c403706f825b35e.tar.gz src-a03b5a5efb70aad04635d8594c403706f825b35e.zip |
Close bin/937 - handle negative timestamps
Notes
Notes:
svn path=/head/; revision=13978
Diffstat (limited to 'bin')
-rw-r--r-- | bin/rcp/rcp.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c index 7e8c5c69c0d1..85b7382a2a05 100644 --- a/bin/rcp/rcp.c +++ b/bin/rcp/rcp.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: rcp.c,v 1.4 1995/05/30 00:07:06 rgrimes Exp $ + * $Id: rcp.c,v 1.5 1995/09/10 14:57:48 markm Exp $ */ #ifndef lint @@ -592,22 +592,21 @@ sink(argc, argv) if (ch == '\n') *--cp = 0; -#define getnum(t) (t) = 0; while (isdigit(*cp)) (t) = (t) * 10 + (*cp++ - '0'); cp = buf; if (*cp == 'T') { setimes++; cp++; - getnum(mtime.tv_sec); - if (*cp++ != ' ') + mtime.tv_sec = strtol(cp, &cp, 10); + if (!cp || *cp++ != ' ') SCREWUP("mtime.sec not delimited"); - getnum(mtime.tv_usec); - if (*cp++ != ' ') + mtime.tv_usec = strtol(cp, &cp, 10); + if (!cp || *cp++ != ' ') SCREWUP("mtime.usec not delimited"); - getnum(atime.tv_sec); - if (*cp++ != ' ') + atime.tv_sec = strtol(cp, &cp, 10); + if (!cp || *cp++ != ' ') SCREWUP("atime.sec not delimited"); - getnum(atime.tv_usec); - if (*cp++ != '\0') + atime.tv_usec = strtol(cp, &cp, 10); + if (!cp || *cp++ != '\0') SCREWUP("atime.usec not delimited"); (void)write(rem, "", 1); continue; |