From 09a55ef62a457d483e5645aa464c16401700e62f Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Fri, 20 Mar 2026 22:14:35 +0000 Subject: [PATCH] Put the constant on the left hand side to avoid accidental assignment if an "=" is omitted (#67). --- src/main/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/main.c b/src/main/main.c index 0fd10db..b8a27a3 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -342,7 +342,7 @@ static int pv__monitor(pvstate_t state, opts_t opts) pipefd_out[1] = -1; /* Pipe for the input side of the command, if we're monitoring it. */ - if ((opts->side == PV_SIDE_IN) || (opts->side == PV_SIDE_BOTH)) { + if ((PV_SIDE_IN == opts->side) || (PV_SIDE_BOTH == opts->side)) { if (0 != pipe(pipefd_in)) { fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno)); return PV_ERROREXIT_MONITOR; @@ -350,7 +350,7 @@ static int pv__monitor(pvstate_t state, opts_t opts) } /* Pipe for the output side of the command, if we're monitoring it. */ - if ((opts->side == PV_SIDE_OUT) || (opts->side == PV_SIDE_BOTH)) { + if ((PV_SIDE_OUT == opts->side) || (PV_SIDE_BOTH == opts->side)) { if (0 != pipe(pipefd_out)) { fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno)); if (-1 != pipefd_in[0])