libbb: fix mishandling of "all argv are opts" in getopt32()
function old new delta top_main 1100 1095 -5 getopt32 1398 1361 -37 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-42) Total: -42 bytes
This commit is contained in:
@@ -763,8 +763,7 @@ int top_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
/* all args are options; -n NUM */
|
||||
opt_complementary = "-:n+";
|
||||
getopt32(argv, "d:n:b", &sinterval, &iterations);
|
||||
if (option_mask32 & OPT_d) {
|
||||
if (getopt32(argv, "d:n:b", &sinterval, &iterations) & OPT_d) {
|
||||
/* Need to limit it to not overflow poll timeout */
|
||||
interval = xatou16(sinterval); // -d
|
||||
}
|
||||
|
Reference in New Issue
Block a user