Skip to content

Commit

Permalink
ostree-prepare-root: Fix parsing of ot-composefs argument
Browse files Browse the repository at this point in the history
We need to compare strcmp() to zero.
  • Loading branch information
alexlarsson committed May 29, 2023
1 parent 0218959 commit 4811d13
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/switchroot/ostree-prepare-root.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,15 @@ main (int argc, char *argv[])
char *composefs_digest = NULL;
if (ot_composefs)
{
if (strcmp (ot_composefs, "off"))
if (strcmp (ot_composefs, "off") == 0)
composefs_mode = OSTREE_COMPOSEFS_MODE_OFF;
else if (strcmp (ot_composefs, "maybe"))
else if (strcmp (ot_composefs, "maybe") == 0)
composefs_mode = OSTREE_COMPOSEFS_MODE_MAYBE;
else if (strcmp (ot_composefs, "on"))
else if (strcmp (ot_composefs, "on") == 0)
composefs_mode = OSTREE_COMPOSEFS_MODE_ON;
else if (strcmp (ot_composefs, "signed"))
else if (strcmp (ot_composefs, "signed") == 0)
composefs_mode = OSTREE_COMPOSEFS_MODE_SIGNED;
else if (strncmp (ot_composefs, "digest=", strlen ("digest=")))
else if (strncmp (ot_composefs, "digest=", strlen ("digest=")) == 0)
{
composefs_mode = OSTREE_COMPOSEFS_MODE_DIGEST;
composefs_digest = ot_composefs + strlen ("digest=");
Expand Down

0 comments on commit 4811d13

Please sign in to comment.