]> git.ipfire.org Git - thirdparty/libarchive.git/commit
[test_utils] Fix a minor UB
authorTim Kientzle <kientzle@acm.org>
Fri, 8 May 2026 04:50:50 +0000 (21:50 -0700)
committerTim Kientzle <kientzle@acm.org>
Fri, 8 May 2026 04:50:50 +0000 (21:50 -0700)
commite46e2c389a60084182a26a7f2bfefc1d2bec031b
tree41ec052a99511ca6907be7d018c59026211754a5
parentb3b546d00873ffa0f156da530c24b842824bd9a9
[test_utils] Fix a minor UB

(UBSan occasionally finds something interesting and
often reports whacky non-bugs like this one. "Fixing"
it will make the real UB bugs easier to identify, so...)

According to C's integer promotion rules, `unsigned short` gets
promoted to _signed_ `int`, and shifting into the sign bit of an `int`
is technically UB.  Explicit cast to `unsigned` quiets UBSan.
test_utils/test_utils.c