Skip to content

Commit

Permalink
Merge pull request #66 from sadeem-albir/patch-7
Browse files Browse the repository at this point in the history
Update getfloat.c
  • Loading branch information
ohkimur authored Mar 12, 2024
2 parents d7272a2 + 88b2b26 commit 7f3097e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapter_5/exercise_5_02/getfloat.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int getfloat(float *pn)
while (isspace(c = getch()))
;

if (!isdigit(c) && c != EOF && c != '+' && c != '-')
if (!isdigit(c) && c != EOF && c != '+' && c != '-' && c != '.')
{
ungetch(c);
return 0;
Expand Down

0 comments on commit 7f3097e

Please sign in to comment.