[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#451886: not a bug; in support of wontfix status



In support of this not being a bug, I have code which uses the
correct, standards-compliant behavior of fgets. Contrary to Andrew's
report, it's very easy to know how much is read by fgets and use it
with data containing '\0'. Simply ensure the buffer does not contain
any occurrances of '\n' (for instance memset to all '\0') before
reading, then use memchr to search for '\n' in the results. If you
find '\n', its position tells how many bytes were read. If not, the
entire buffer was filled without reaching a newline.




Reply to: