mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 03:49:02 +00:00
seq: combine asprintf return value checks
Error handling is identical for all of these failure cases. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
ee0aa1ce12
commit
5dae8905a5
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user