From a61f9a91731d3da0f1e7172a45a3dceedb020e55 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Fri, 28 Oct 2022 17:24:10 +0530 Subject: [PATCH] fix: replace POSTJECT_SENTINEL_STRING macro with a const char* Maybe that will fix this error: ``` Error: Could not find the sentinel POSTJECT_SENTINEL_fce680ab2cc467b6e072b8b5df1996b2: in the binary at inject (dist/api.js:5147:11) at async Context. (file:///home/circleci/project/test/cli.mjs:138:7) ``` Refs: https://app.circleci.com/pipelines/github/postmanlabs/postject/197/workflows/741145b6-e19e-4d09-b995-49eebc237962/jobs/1580 Signed-off-by: Darshan Sen --- postject-api.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/postject-api.h b/postject-api.h index 7efe8d7..7145d27 100644 --- a/postject-api.h +++ b/postject-api.h @@ -37,10 +37,8 @@ inline void postject_options_init(struct postject_options* options) { } static inline bool postject_has_resource() { -#define POSTJECT_SENTINEL_STRING \ - "POSTJECT_SENTINEL_fce680ab2cc467b6e072b8b5df1996b2:0" - return POSTJECT_SENTINEL_STRING[sizeof(POSTJECT_SENTINEL_STRING) - 2] == '1'; -#undef POSTJECT_SENTINEL_STRING + const char* sentinel = "POSTJECT_SENTINEL_fce680ab2cc467b6e072b8b5df1996b2:0"; + return sentinel[strlen(sentinel) - 1] == '1'; } static const void* postject_find_resource(