Skip to content

Commit

Permalink
xgetXXbyYY: Avoid duplicated error handling block
Browse files Browse the repository at this point in the history
The error handling is performed after the loop. By just calling break it
is possible to reuse the error handling if status is not ERANGE.

Signed-off-by: Samanta Navarro <[email protected]>
  • Loading branch information
ferivoz authored and hallyn committed May 26, 2023
1 parent e73a219 commit dcc9065
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libmisc/xgetXXbyYY.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@
}

if (ERANGE != status) {
free (buffer);
free (result);
return NULL;
break;
}

if (length <= ((size_t)-1 / 4)) {
Expand Down

0 comments on commit dcc9065

Please sign in to comment.