On Tue, Aug 12, 2014 at 06:38:38PM +0200, René Scharfe wrote:
> Am 11.08.2014 um 23:11 schrieb Stefan Beller:
> >This was found by coverity. (Id: 290001)
> >
> >the variable 'output' is only assigned to a value inequal to NUL,
> >after all gotos to the corrupt label.
> >Therefore we can conclude t
Stefan Beller wrote:
> This was found by coverity. (Id: 290001)
[...]
> Signed-off-by: Stefan Beller
> Helped-by: René Scharfe
> ---
> builtin/mailsplit.c | 17 ++---
> 1 file changed, 6 insertions(+), 11 deletions(-)
The idea is to simplify error handling (removing cleanup of the
Junio C Hamano writes:
> Matthieu Moy writes:
>
>> Stefan Beller writes:
>>
>>> + if (is_bare && !allow_bare) {
>>> + unlink(name);
>>> + fprintf(stderr, "corrupt mailbox\n");
>>> + exit(1);
>>> + }
>>
>> Not directly related to your patch, but shouldn't this b
... answering to myself, the only invoker does not seem to care,
so I do not mind if the fprintf/exit gets turned into die() in a
follow-up patch.
Thanks.
On Tue, Aug 12, 2014 at 2:38 PM, Junio C Hamano wrote:
> Matthieu Moy writes:
>
>> Stefan Beller writes:
>>
>>> +if (is_bare && !allow_
Matthieu Moy writes:
> Stefan Beller writes:
>
>> +if (is_bare && !allow_bare) {
>> +unlink(name);
>> +fprintf(stderr, "corrupt mailbox\n");
>> +exit(1);
>> +}
>
> Not directly related to your patch, but shouldn't this be using
>
> die(_("corrupt mailb
Stefan Beller writes:
> + if (is_bare && !allow_bare) {
> + unlink(name);
> + fprintf(stderr, "corrupt mailbox\n");
> + exit(1);
> + }
Not directly related to your patch, but shouldn't this be using
die(_("corrupt mailbox"));
instead?
--
Matthieu M
This was found by coverity. (Id: 290001)
The variable 'output' is assigned to a value
after all gotos to the corrupt label.
Remove the goto by moving the errorhandling code to the
condition, which detects the error.
Signed-off-by: Stefan Beller
Helped-by: René Scharfe
---
builtin/mailsplit.c
Am 11.08.2014 um 23:11 schrieb Stefan Beller:
This was found by coverity. (Id: 290001)
the variable 'output' is only assigned to a value inequal to NUL,
after all gotos to the corrupt label.
Therefore we can conclude the two removed lines are actually dead code.
After reading the above for the
This was found by coverity. (Id: 290001)
the variable 'output' is only assigned to a value inequal to NUL,
after all gotos to the corrupt label.
Therefore we can conclude the two removed lines are actually dead code.
Signed-off-by: Stefan Beller
---
builtin/mailsplit.c | 2 --
1 file changed, 2
9 matches
Mail list logo