From f0231f29720677565b2d814b2db89d3f64e51d29 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" <114750+alfredh@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:31:22 +0200 Subject: [PATCH] dd: fix for clang analyze --- src/dd/putbit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dd/putbit.c b/src/dd/putbit.c index 431210a08..16954f815 100644 --- a/src/dd/putbit.c +++ b/src/dd/putbit.c @@ -62,7 +62,8 @@ int putbit_write(struct putbit *pb, unsigned count, unsigned val) for (unsigned i=0; i> (count-i-1)) & 0x1; + unsigned shift = count-i-1; + unsigned bit = (val >> shift) & 0x1; int err = putbit_one(pb, bit); if (err)