Bug 20640 - Errors in example for WEOF macro
Summary: Errors in example for WEOF macro
Status: UNCONFIRMED
Alias: None
Product: glibc
Classification: Unclassified
Component: manual (show other bugs)
Version: 2.23
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-27 02:58 UTC by Igor Liferenko
Modified: 2016-10-04 10:47 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Liferenko 2016-09-27 02:58:06 UTC
Hi all,

In the following extract from libc reference "< 0" must be changed to "> 0" and "wgetc" must be changed to "getwc":

    In other words, sloppy code like
    {
      int c;
      ...
      while ((c = getc (fp)) < 0)
      ...
    }
    has to be rewritten to use WEOF explicitly when wide characters are used:
    {
      wint_t c;
      ...
      while ((c = wgetc (fp)) != WEOF)
      ...
    }

Regards,
Igor