From b31c5d878de53c575964de18ce244aa104f5101d Mon Sep 17 00:00:00 2001 From: Nick Krecklow Date: Tue, 12 Apr 2022 11:31:42 -0500 Subject: [PATCH] fix: `tf_read_uint24` should use BITOR, not BITAND --- CMakeLists.txt | 2 +- tinyfseq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c56cf0a..357f25f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.21) project(tinyfseq - VERSION 1.0.0 + VERSION 1.0.1 DESCRIPTION "A tiny library for decoding FSEQ (.fseq) v2.0+ sequence files" HOMEPAGE_URL "https://github.com/Cryptkeeper/libtinyfseq" LANGUAGES C) diff --git a/tinyfseq.c b/tinyfseq.c index c37c615..b4c05b5 100644 --- a/tinyfseq.c +++ b/tinyfseq.c @@ -116,7 +116,7 @@ enum tf_err_t tf_read_var_header(const uint8_t *bd, int bs, struct tf_var_header static uint32_t tf_read_uint24(const uint8_t *bd) { // WARNING: this assumes little endian byte order - return (uint32_t) (bd[0] & (bd[1] << 8) & (bd[2] << 16)); + return (uint32_t) (bd[0] | (bd[1] << 8) | (bd[2] << 16)); } enum tf_err_t tf_read_channel_range(const uint8_t *bd, int bs, struct tf_channel_range_t *channelRange, uint8_t **ep) {