Files
Sergei Trofimovich 6827e8d3e8 libbladeRF: fix clang build
Without the change the build fails as
https://hydra.nixos.org/build/313370704:

    /private/tmp/nix-build-libbladeRF-2025.10.drv-0/source/host/utilities/bladeRF-cli/src/cmd/flash_image.c:71:35:
      error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare]
       71 |                 if (val[i] >= 'a' || val[i] <= 'f') {
          |                     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
2025-11-18 06:34:33 +00:00

13 lines
647 B
Diff

Fix clang build: https://github.com/Nuand/bladeRF/pull/1045.patch
--- a/host/utilities/bladeRF-cli/src/cmd/flash_image.c
+++ b/host/utilities/bladeRF-cli/src/cmd/flash_image.c
@@ -68,7 +68,7 @@ static int handle_param(const char *param, char *val,
status = CLI_RET_INVPARAM;
} else {
for (i = 0; i < len && status == 0; i++) {
- if (val[i] >= 'a' || val[i] <= 'f') {
+ if (val[i] >= 'a' && val[i] <= 'f') {
val[i] -= 'a' - 'A';
} else if (!((val[i] >= '0' && val[i] <= '9') ||
(val[i] >= 'A' && val[i] <= 'F'))) {