Skip to content

Commit

Permalink
Define deploymentIndex as a guint before setting it
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Sturla <[email protected]>
  • Loading branch information
p5 committed Jan 23, 2024
1 parent 2f3bc0c commit 1fbe052
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/ostree/ot-admin-builtin-status.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ ot_admin_builtin_status (int argc, char **argv, OstreeCommandInvocation *invocat
g_autoptr (GPtrArray) deployments = ostree_sysroot_get_deployments (sysroot);
OstreeDeployment *booted_deployment = ostree_sysroot_get_booted_deployment (sysroot);

guint deploymentIndex = G_MAXUINT;
g_autoptr (OstreeDeployment) pending_deployment = NULL;
g_autoptr (OstreeDeployment) rollback_deployment = NULL;
if (booted_deployment)
Expand All @@ -242,32 +243,32 @@ ot_admin_builtin_status (int argc, char **argv, OstreeCommandInvocation *invocat
}
else if (opt_booted_index)
{
index = findDeploymentIndex (booted_deployment, deployments);
if (index != G_MAXUINT)
deploymentIndex = findDeploymentIndex (booted_deployment, deployments);
if (deploymentIndex != G_MAXUINT)
{
g_print ("%d\n", index);
g_print ("%d\n", deploymentIndex);
return TRUE;
}

return FALSE;
}
else if (opt_pending_index)
{
index = findDeploymentIndex (pending_deployment, deployments);
if (index != G_MAXUINT)
deploymentIndex = findDeploymentIndex (pending_deployment, deployments);
if (deploymentIndex != G_MAXUINT)
{
g_print ("%d\n", index);
g_print ("%d\n", deploymentIndex);
return TRUE;
}

return FALSE;
}
else if (opt_rollback_index)
{
index = findDeploymentIndex (rollback_deployment, deployments);
if (index != G_MAXUINT)
deploymentIndex = findDeploymentIndex (rollback_deployment, deployments);
if (deploymentIndex != G_MAXUINT)
{
g_print ("%d\n", index);
g_print ("%d\n", deploymentIndex);
return TRUE;
}

Expand Down

0 comments on commit 1fbe052

Please sign in to comment.