falconindy / expac

alpm data extraction utility
91 stars 15 forks source link

use feof to check for EOF when reading from stream #37

Closed polygamma closed 6 years ago

polygamma commented 6 years ago

Hey!

see: https://github.com/polygamma/aurman/issues/200

Due to the usage of signed chars on ARM, https://github.com/falconindy/expac/blob/master/expac.c#L806 can never be true, ending in an endless loop, as can be seen in the mentioned issue. This PR fixes the problem, by using feof to detect the EOF. I tested, that this indeed fixes the problem, see: https://github.com/polygamma/aurman/issues/200#issuecomment-402704777

It is nevertheless nicer to use feof in that case, regardless of the bug.

falconindy commented 6 years ago

Well, this is a dupe of #36, but I like this solution better.

No, I'm not doing another expac release just for this.