+2005-08-27 Hrvoje Niksic <hniksic@xemacs.org>
+
+ * cmpt.c (strtoll): Correctly handle strtoll("0x", ptr, 0) and
+ strtoll("0x<nonhexchar>", ptr, 0) -- in both cases *ptr must be
+ set to the position of 'x', not after it.
+
2005-08-27 Hrvoje Niksic <hniksic@xemacs.org>
* hash.c (hash_table_map): Rename to hash_table_for_each and
{
base = 16;
nptr += 2;
+ /* "0x" must be followed by at least one hex char. If not,
+ return 0 and place ENDPTR on 'x'. */
+ if (!ISXDIGIT (*nptr))
+ {
+ --nptr;
+ goto out;
+ }
}
else if (base == 0)
base = 8;
result = newresult;
}
}
+ out:
if (endptr)
*endptr = (char *) nptr;
return result;