Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/ed clear errno before strtol() if we're going to test it...



details:   https://anonhg.NetBSD.org/src/rev/6794af373fe2
branches:  trunk
changeset: 545857:6794af373fe2
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Apr 17 02:54:07 2003 +0000

description:
clear errno before strtol() if we're going to test it for ERANGE afterwards

diffstat:

 bin/ed/ed.h |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 7683780f45ad -r 6794af373fe2 bin/ed/ed.h
--- a/bin/ed/ed.h       Thu Apr 17 02:41:21 2003 +0000
+++ b/bin/ed/ed.h       Thu Apr 17 02:54:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ed.h,v 1.30 2002/05/25 23:29:17 wiz Exp $      */
+/*     $NetBSD: ed.h,v 1.31 2003/04/17 02:54:07 lukem Exp $    */
 
 /* ed.h: type and constant definitions for the ed editor. */
 /*
@@ -112,6 +112,7 @@
 
 /* STRTOL: convert a string to long */
 #define STRTOL(i, p) { \
+       errno = 0 ; \
        if (((i = strtol(p, &p, 10)) == LONG_MIN || i == LONG_MAX) && \
            errno == ERANGE) { \
                sprintf(errmsg, "number out of range"); \



Home | Main Index | Thread Index | Old Index