busctl: fix assertion failure on --size option
Using --size option triggers an assert failure below because parse_size() requires the second argument, base, being either 1000 or 1024. As it's for a packet size, it'd be better using IEC binary suffix (base 1024) IMHO. $ busctl --size 2048 Assertion 'base == 1000 || base == 1024' failed at src/basic/util.c:2222, function parse_size(). Aborting. Aborted (core dumped)
This commit is contained in:
@@ -1825,7 +1825,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
case ARG_SIZE: {
|
||||
off_t o;
|
||||
|
||||
r = parse_size(optarg, 0, &o);
|
||||
r = parse_size(optarg, 1024, &o);
|
||||
if (r < 0) {
|
||||
log_error("Failed to parse size: %s", optarg);
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user