mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
usr.bin/units: use else..if to avoid calling the next branch
Even if the first branch succeeds, next time it will still check for the second branch (which will be false) as the first one was true. Add an else..if statement to address this. Signed-off-by: rilysh <nightquick@proton.me> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1165
This commit is contained in:
parent
1f2776e123
commit
0bdcfb08f2
1 changed files with 1 additions and 2 deletions
|
|
@ -497,8 +497,7 @@ lookupunit(const char *unit)
|
|||
}
|
||||
}
|
||||
free(copy);
|
||||
}
|
||||
if (unit[strlen(unit) - 1] == 's') {
|
||||
} else if (unit[strlen(unit) - 1] == 's') {
|
||||
copy = dupstr(unit);
|
||||
copy[strlen(copy) - 1] = 0;
|
||||
for (i = 0; i < unitcount; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue