[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] diffutils: check freopen() return value
From: |
Vincent Legoll |
Subject: |
[PATCH] diffutils: check freopen() return value |
Date: |
Sat, 11 Apr 2009 14:02:10 +0200 |
Hello,
the "sparse" code analysis tool warns about unchecked return
value for freopen() calls.
Not knowing if a failure from freopen() would be harmless, I
came up with the attached patches. It checks the return value
and reports the error.
Should those errors be ignored instead ? In that case maybe
adding a comment to the code and an explicit (void) cast,
would help people staring at that code understand why it's
unchecked.
The diff.c hunk is not as straightforward as the cmp.c one,
please tell me if this is the right way to do it.
The whitespace is strange, please ask if it needs to be fixed
in any way.
--
Vincent Legoll
check-cmp-freopen-retval.patch
Description: Text Data
check-diff-freopen-retval.patch
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] diffutils: check freopen() return value,
Vincent Legoll <=