Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Referenced Annex J.

Wiki Markup
If the C99 {{fgets()}} function fails, the contents of the array it was writing to are undefined  [indeterminate| BB. Definitions#indeterminate value] \[[ISO/IEC 9899:1999|AA. C References#ISO/IEC 9899-1999]\] (see also [undefined behavior 161| CC. Undefined Behavior#ub_161] of Annex J). Consequently, it is necessary to reset the string to a known value to avoid possible errors on subsequent string manipulation functions.

...