diff --git a/src/lxc/utils.c b/src/lxc/utils.c index 77ad76b49..9795b51b6 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -898,10 +898,10 @@ static char *get_nextpath(char *path, int *offsetp, int fulllen) if (offset >= fulllen) return NULL; - while (path[offset] != '\0' && offset < fulllen) + while (offset < fulllen && path[offset] != '\0') offset++; - while (path[offset] == '\0' && offset < fulllen) + while (offset < fulllen && path[offset] == '\0') offset++; *offsetp = offset;