From 3f59fa9bd9eec82255b274e702e20b0a6d85e16c Mon Sep 17 00:00:00 2001 From: cgd Date: Fri, 9 Apr 1993 12:27:23 +0000 Subject: [PATCH] from patch 108, by jordan hubbard: The value of endp returned by strtod() was off by one. There was also a const char * vs char * assignment that I took the opportunity to fix. --- lib/libc/i386/stdlib/atof.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/libc/i386/stdlib/atof.c b/lib/libc/i386/stdlib/atof.c index 70f1c7e21ab0..0652f4262346 100644 --- a/lib/libc/i386/stdlib/atof.c +++ b/lib/libc/i386/stdlib/atof.c @@ -33,14 +33,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00089 - * -------------------- ----- ---------------------- - * - * 27 Feb 93 Joerg Wunsch Implement strtod, fix atof. - * */ #if defined(LIBC_SCCS) && !defined(lint) @@ -153,7 +145,7 @@ strtod(p, endp) /* according to ANSI, check for over-/underflow */ if(exp > 0) { if(endp) - *endp = oldp; + *endp = (char *)oldp; errno = ERANGE; return neg < 0? -HUGE_VAL: HUGE_VAL; } @@ -166,7 +158,7 @@ strtod(p, endp) fl = ldexp(fl, bexp); if(endp) - *endp = p; + *endp = (char *)(p - 1); return neg < 0 ? -fl : fl; }