[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: printf produces no output for %f directive
From: |
Jim Meyering |
Subject: |
Re: printf produces no output for %f directive |
Date: |
Fri, 19 Oct 2007 15:27:42 +0200 |
Eric Blake <address@hidden> wrote:
> According to Andreas Schwab on 10/19/2007 6:58 AM:
>> Jim Meyering <address@hidden> writes:
>>
>>> Could it be a bug in printf for failing, yet not setting the
>>> stream-failure indicator that is checked by close_stdout's ferror?
>>
>> A failure from printf does not necessarily mean an output failure. It
>> can also be ENOMEM or EILSEQ, which are unrelated to output.
>
> Wow. You're right. Which means the return value of printf/fprintf must
> always be checked in a secure program. It looks like m4 has some bugs in
> this area (admittedly corner case, since it is not on user-provided
> strings with large padding values, so the likelihood of running out of
> memory exactly during the printf is smaller)...
>
> Would it be worth a xprintf and xfprintf gnulib wrapper that exits the
> program immediately on non-output errors from the wrapped printf/fprintf?
Yep. That's what I'm doing :)
- printf produces no output for %f directive, Bruno Haible, 2007/10/19
- Re: printf produces no output for %f directive, Jim Meyering, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Andreas Schwab, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Eric Blake, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Jim Meyering, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Eric Blake, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Nick Stoughton, 2007/10/19
- Re: POSIX requires checking all *printf return values?!?, Bruce Korb, 2007/10/22