Reluctantly remove one of the most extraordinary numeric conversion

routines I have ever seen and replace with something far more boring.
This commit is contained in:
Greg Lehey 2012-12-13 01:44:58 +00:00
parent 7b4708028a
commit d6a381f8c9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244166

View file

@ -940,15 +940,13 @@ indextooffset(char *s)
{
int i;
struct fixs *n;
char *es;
if (s[0] == '+' || s[0] == '-') {
char ss[9];
for (i = -100; i < 100; i++) {
sprintf(ss, "%s%d", (i > 0) ? "+" : "", i);
if (strcmp(ss, s) == 0)
return (i);
}
return (0);
i = strtod (s, &es);
if (*es != '\0') /* trailing junk */
errx (1, "Invalid specifier format: %s\n", s);
return (i);
}
for (i = 0; i < 6; i++) {