Menu

#415 Store fgetc() return value in int for comparison with EOF

Bug
closed-fixed
nobody
None
5
2021-08-31
2021-07-29
No

The return value of fgetc() must be stored in an int if it is compared against EOF.

As is, the check for EOF (-1) in RemoveM3U() is buggy:
On architectures that default to signed chars, reading 0xff will be mistaken for EOF.
On architectures that default to unsigned chars (arm, ppc), EOF will never be recognized.

Trivial patch attached.

1 Attachments

Discussion

  • Solbu

    Solbu - 2021-08-31

    For some reason I missed/forgot this bug repport.

    Thanks for fixing. :-)

     
  • Solbu

    Solbu - 2021-08-31
    • status: open --> closed-fixed
     
  • Solbu

    Solbu - 2021-08-31

    Wil be fixed in next release

     

Log in to post a comment.

MongoDB Logo MongoDB