diff options
| author | Mariusz Zaborski <oshogbo@FreeBSD.org> | 2022-09-30 17:36:04 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2023-06-26 16:30:31 +0000 |
| commit | 6403f0ac1281a9f95f387c98ef17f88f59714e56 (patch) | |
| tree | b29929985dfa49d4612110bd010a5ff0c44dd72b /usr.bin/seq | |
| parent | e982b1cf1fe1dc0b84dc24f03d1c21e3fe6bdef3 (diff) | |
Diffstat (limited to 'usr.bin/seq')
| -rw-r--r-- | usr.bin/seq/seq.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/seq/seq.c b/usr.bin/seq/seq.c index 7559dbd9ce20..47ba0b7ce3af 100644 --- a/usr.bin/seq/seq.c +++ b/usr.bin/seq/seq.c @@ -199,8 +199,12 @@ main(int argc, char *argv[]) * loop held true due to a rounding error and we still need to print * 'last'. */ - asprintf(&cur_print, fmt, cur); - asprintf(&last_print, fmt, last); + if (asprintf(&cur_print, fmt, cur) < 0) { + err(1, "asprintf"); + } + if (asprintf(&last_print, fmt, last) < 0) { + err(1, "asprintf"); + } if (strcmp(cur_print, last_print) == 0 && cur != last_shown_value) { fputs(last_print, stdout); fputs(sep, stdout); |
