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.
AUTHOR: Jordan K. Hubbard
386BSD-Patchkit: patch00108
*
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
* -------------------- ----- ----------------------
*
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
* -------------------- ----- ----------------------
- * CURRENT PATCH LEVEL: 1 00089
+ * CURRENT PATCH LEVEL: 2 00108
* -------------------- ----- ----------------------
*
* 27 Feb 93 Joerg Wunsch Implement strtod, fix atof.
* -------------------- ----- ----------------------
*
* 27 Feb 93 Joerg Wunsch Implement strtod, fix atof.
+ * 28 Mar 93 Jordan Hubbard Fix stdtod bug with endp, remove warnings.
/* according to ANSI, check for over-/underflow */
if(exp > 0) {
if(endp)
/* according to ANSI, check for over-/underflow */
if(exp > 0) {
if(endp)
errno = ERANGE;
return neg < 0? -HUGE_VAL: HUGE_VAL;
}
errno = ERANGE;
return neg < 0? -HUGE_VAL: HUGE_VAL;
}
fl = ldexp(fl, bexp);
if(endp)
fl = ldexp(fl, bexp);
if(endp)
+ *endp = (char *)(p - 1);
return neg < 0 ? -fl : fl;
}
return neg < 0 ? -fl : fl;
}