From: Denys Vlasenko Date: Sun, 17 Oct 2010 10:44:39 +0000 (+0200) Subject: seq: exit on write errors X-Git-Tag: 1_18_0~139 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=786635e62e4c8a8646d01ede1c7bb98ce604c7fa;p=oweals%2Fbusybox.git seq: exit on write errors Signed-off-by: Denys Vlasenko --- diff --git a/coreutils/seq.c b/coreutils/seq.c index 8be25360f..22bf3ec9d 100644 --- a/coreutils/seq.c +++ b/coreutils/seq.c @@ -86,7 +86,8 @@ int seq_main(int argc, char **argv) v = first; n = 0; while (increment >= 0 ? v <= last : v >= last) { - printf("%s%0*.*f", sep, width, frac_part, v); + if (printf("%s%0*.*f", sep, width, frac_part, v) < 0) + break; /* I/O error, bail out (yes, this really happens) */ sep = opt_s; /* v += increment; - would accumulate floating point errors */ n++;