diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2023-06-19 02:10:32 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2023-06-25 23:57:17 +0000 |
| commit | 5dae8905a5141e0cba1f4f3f94116440a5ce2abb (patch) | |
| tree | 11fa3fd3d58afd36ff026e7aff922bd1fe1c9301 /usr.bin/seq | |
| parent | ee0aa1ce12b3caea34477a31e9d2111a329e33b9 (diff) | |
Diffstat (limited to 'usr.bin/seq')
| -rw-r--r-- | usr.bin/seq/seq.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/seq/seq.c b/usr.bin/seq/seq.c index 3618a106ec9e..d1d2cfbf17ed 100644 --- a/usr.bin/seq/seq.c +++ b/usr.bin/seq/seq.c @@ -198,13 +198,9 @@ main(int argc, char *argv[]) * equal, it means the exit condition of the loop held true due to a * rounding error and we still need to print 'last'. */ - if (asprintf(&cur_print, fmt, cur) < 0) { - err(1, "asprintf"); - } - if (asprintf(&last_print, fmt, last) < 0) { - err(1, "asprintf"); - } - if (asprintf(&prev_print, fmt, prev) < 0) { + if (asprintf(&cur_print, fmt, cur) < 0 || + asprintf(&last_print, fmt, last) < 0 || + asprintf(&prev_print, fmt, prev) < 0) { err(1, "asprintf"); } if (strcmp(cur_print, last_print) == 0 && |
