Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
381cd4bb
Commit
381cd4bb
authored
May 12, 1995
by
Karl Heuer
Browse files
(float_to_string): Fix type mismatch and simplify.
parent
01d8fc64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
src/print.c
src/print.c
+11
-9
No files found.
src/print.c
View file @
381cd4bb
...
...
@@ -668,19 +668,21 @@ float_to_string (buf, data)
/* Check the width specification. */
width
=
-
1
;
if
(
'0'
<=
*
cp
&&
*
cp
<=
'9'
)
for
(
width
=
0
;
(
*
cp
>=
'0'
&&
*
cp
<=
'9'
);
cp
++
)
width
=
(
width
*
10
)
+
(
*
cp
-
'0'
);
{
width
=
0
;
do
width
=
(
width
*
10
)
+
(
*
cp
++
-
'0'
);
while
(
*
cp
>=
'0'
&&
*
cp
<=
'9'
);
/* A precision of zero is valid only for %f. */
if
(
width
>
DBL_DIG
||
(
width
==
0
&&
*
cp
!=
'f'
))
goto
lose
;
}
if
(
*
cp
!=
'e'
&&
*
cp
!=
'f'
&&
*
cp
!=
'g'
)
goto
lose
;
/* A precision of zero is valid for %f; everything else requires
at least one. Width may be omitted anywhere. */
if
(
width
!=
-
1
&&
(
width
<
(
*
cp
!=
'f'
)
||
width
>
DBL_DIG
))
goto
lose
;
if
(
cp
[
1
]
!=
0
)
goto
lose
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment