mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-16 18:41:21 +00:00
Avoid hardcoded string length
Use strlen() on "state" variable instead of harcoded value 6. Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
This commit is contained in:
parent
60014557dc
commit
db1228b35f
@ -52,10 +52,11 @@ static int do_freeze_thaw(bool freeze, struct lxc_conf *conf, const char *name,
|
|||||||
char v[100];
|
char v[100];
|
||||||
struct cgroup_ops *cgroup_ops;
|
struct cgroup_ops *cgroup_ops;
|
||||||
const char *state;
|
const char *state;
|
||||||
size_t state_len = 6;
|
size_t state_len;
|
||||||
lxc_state_t new_state = freeze ? FROZEN : THAWED;
|
lxc_state_t new_state = freeze ? FROZEN : THAWED;
|
||||||
|
|
||||||
state = lxc_state2str(new_state);
|
state = lxc_state2str(new_state);
|
||||||
|
state_len = strlen(state);
|
||||||
|
|
||||||
cgroup_ops = cgroup_init(conf);
|
cgroup_ops = cgroup_init(conf);
|
||||||
if (!cgroup_ops)
|
if (!cgroup_ops)
|
||||||
|
Loading…
Reference in New Issue
Block a user