diff --git a/.github/workflows/build-and-test-rh.yml b/.github/workflows/build-and-test-rh.yml index bb82d29..e2df65d 100644 --- a/.github/workflows/build-and-test-rh.yml +++ b/.github/workflows/build-and-test-rh.yml @@ -95,12 +95,21 @@ jobs: run: sudo yum -y install findutils - name: Checkout shell test framework + if: matrix.image != 'centos:7' uses: actions/checkout@v4 with: repository: kward/shunit2 path: ${{github.workspace}}/tests/shunit2 fetch-depth: 1 + - name: Checkout shell test framework centos7 + if: matrix.image == 'centos:7' + uses: actions/checkout@v3 + with: + repository: kward/shunit2 + path: ${{github.workspace}}/tests/shunit2 + fetch-depth: 1 + - name: Run additional tests shell: bash run: tests/scripts/tests.sh diff --git a/include/sexpp/sexp.h b/include/sexpp/sexp.h index 9e2d1fd..de0d093 100644 --- a/include/sexpp/sexp.h +++ b/include/sexpp/sexp.h @@ -251,12 +251,14 @@ class SEXP_PUBLIC_SYMBOL sexp_string_t : public sexp_object_t { inline bool operator==(const sexp_string_t *left, const std::string &right) noexcept { - return memcmp(left->get_string().data(), right.c_str(), right.size()) == 0; + return left->get_string().size() == right.length() && + memcmp(left->get_string().data(), right.c_str(), left->get_string().size()) == 0; } inline bool operator!=(const sexp_string_t *left, const std::string &right) noexcept { - return memcmp(left->get_string().data(), right.c_str(), right.size()) != 0; + return left->get_string().size() != right.length() || + memcmp(left->get_string().data(), right.c_str(), left->get_string().size()) != 0; } /*