Opened 5 years ago

#299 new defect

freopen() returns NULL even if it is successful

Reported by: komh Owned by:
Priority: normal Milestone: libc-0.7
Component: libc Version: 0.6.5
Severity: normal Keywords:
Cc:

Description

Hi/2.

Like the subject, freopen() returns NULL even if it is successful if filename is NULL.

For examples,

    FILE *fp = freopen( NULL, "rb", stdin );

fp is set to NULL. However, stdin is changed to binary mode correctly.

Attachments (2)

freopen.c (1.5 KB) - added by komh 5 years ago.
Test case for freopen()
freopen.diff (629 bytes) - added by komh 5 years ago.
patch for freopen()

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by komh

Test case for freopen()

Changed 5 years ago by komh

patch for freopen()

Note: See TracTickets for help on using tickets.