mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-20 11:11:24 +00:00
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:
parent
7b4708028a
commit
d6a381f8c9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244166
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user