Skip to content

Commit

Permalink
FIX: overrides: add skipPrefix to IS_HEADER_MATCH macro
Browse files Browse the repository at this point in the history
  • Loading branch information
justadreamer committed Oct 7, 2024
1 parent 1db1c0d commit a815adb
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions overrides.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ static void collectionRelease(Item *item) {
/* Prefix to use when comparing property names. */
#define OVERRIDE_PREFIX "51D_"

/**
* Checks if the pair (p) have a field name that matches the target (t).
* The last byte of t is null where as fieldLength is the length of printable
* characters. Take 1 from the t to compare length.
*/
#define IS_HEADER_MATCH(t,p) \
(sizeof(t) - 1 == p->fieldLength && \
StringCompareLength(p->field, t, sizeof(t)) == 0)
/**
* Checks if the pair (p) have a field name that matches the target (t).
* The last byte of t is null where as fieldLength is the length of printable
* characters. Take 1 from the t to compare length.
*/
#define IS_HEADER_MATCH(t,p) \
(StringCompareLength(skipPrefix(true, (char*)pair->field), t, sizeof(t)) == 0)

static const Collection dummyCollection = {
NULL,
Expand Down

0 comments on commit a815adb

Please sign in to comment.