Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
mihalicyn committed Apr 2, 2024
1 parent 0b4d411 commit 74704c0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/lxc/confile.c
Original file line number Diff line number Diff line change
Expand Up @@ -2963,18 +2963,18 @@ static int set_config_time_offset_boot(const char *key, const char *value,

unit = lxc_trim_whitespace_in_place(buf);
if (strequal(unit, "h")) {
if (check_mul_overflow(offset, 3600, &lxc_conf->timens.s_boot))
if (check_mul_overflow(offset, (typeof(offset))3600, &lxc_conf->timens.s_boot))
return ret_errno(EOVERFLOW);
} else if (strequal(unit, "m")) {
if (check_mul_overflow(offset, 60, &lxc_conf->timens.s_boot))
if (check_mul_overflow(offset, (typeof(offset))60, &lxc_conf->timens.s_boot))
return ret_errno(EOVERFLOW);
} else if (strequal(unit, "s")) {
lxc_conf->timens.s_boot = offset;
} else if (strequal(unit, "ms")) {
if (check_mul_overflow(offset, 1000000, &lxc_conf->timens.ns_boot))
if (check_mul_overflow(offset, (typeof(offset))1000000, &lxc_conf->timens.ns_boot))
return ret_errno(EOVERFLOW);
} else if (strequal(unit, "us")) {
if (check_mul_overflow(offset, 1000, &lxc_conf->timens.ns_boot))
if (check_mul_overflow(offset, (typeof(offset))1000, &lxc_conf->timens.ns_boot))
return ret_errno(EOVERFLOW);
} else if (strequal(unit, "ns")) {
lxc_conf->timens.ns_boot = offset;
Expand Down Expand Up @@ -3002,18 +3002,18 @@ static int set_config_time_offset_monotonic(const char *key, const char *value,

unit = lxc_trim_whitespace_in_place(buf);
if (strequal(unit, "h")) {
if (check_mul_overflow(offset, 3600, &lxc_conf->timens.s_monotonic))
if (check_mul_overflow(offset, (typeof(offset))3600, &lxc_conf->timens.s_monotonic))
return ret_errno(EOVERFLOW);
} else if (strequal(unit, "m")) {
if (check_mul_overflow(offset, 60, &lxc_conf->timens.s_monotonic))
if (check_mul_overflow(offset, (typeof(offset))60, &lxc_conf->timens.s_monotonic))
return ret_errno(EOVERFLOW);
} else if (strequal(unit, "s")) {
lxc_conf->timens.s_monotonic = offset;
} else if (strequal(unit, "ms")) {
if (check_mul_overflow(offset, 1000000, &lxc_conf->timens.ns_monotonic))
if (check_mul_overflow(offset, (typeof(offset))1000000, &lxc_conf->timens.ns_monotonic))
return ret_errno(EOVERFLOW);
} else if (strequal(unit, "us")) {
if (check_mul_overflow(offset, 1000, &lxc_conf->timens.ns_monotonic))
if (check_mul_overflow(offset, (typeof(offset))1000, &lxc_conf->timens.ns_monotonic))
return ret_errno(EOVERFLOW);
} else if (strequal(unit, "ns")) {
lxc_conf->timens.ns_monotonic = offset;
Expand Down

0 comments on commit 74704c0

Please sign in to comment.