+Sun Jan 14 01:01:10 1996 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
+
+ * stdlib/strtol.c: Return correct pointer for strings
+ like "0xyz" and base 0 or 16.
+
+ * string/strxfrm.c: Handle case for LENGTH == 0 correct.
+
+ * sunrpc/etc.rpc: Add some more known protocols.
+
Fri Jan 12 13:40:01 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* posix/gnu/types.h: Moved to sysdeps/generic/gnu/types.h.
if (base < 0 || base == 1 || base > 36)
base = 10;
- s = nptr;
+ save = s = nptr;
/* Skip white space. */
while (isspace (*s))
return (negative ? -i : i);
noconv:
- /* There was no number to convert. */
+ /* We must handle a special case here: the base is 0 or 16 and the
+ first two characters and '0' and 'x', but the rest are no
+ hexadecimal digits. This is no error case. We return 0 and
+ ENDPTR points to the `x`. */
if (endptr != NULL)
- *endptr = (char *) nptr;
+ if (save - nptr >= 2 && tolower (save[-1]) == 'x' && save[-2] == '0')
+ *endptr = (char *) &save[-1];
+ else
+ /* There was no number to convert. */
+ *endptr = (char *) nptr;
+
return 0L;
}
\f