diff --git a/src/sleuth.c b/src/sleuth.c index a677139..d51326a 100644 --- a/src/sleuth.c +++ b/src/sleuth.c @@ -5,11 +5,16 @@ #include struct gargoyle_opt *gargoyle_find_brand(uint16_t optc, struct gargoyle_opt *optv, const char *brand, const char *neg, uint16_t neg_sz, gargoyle_flag_type flags) { + if(!neg) { + neg = "no-"; + neg_sz = 3; + } + for(; optc; optc -= 1, optv += 1) { const char *idx = brand; if(optv->type & GARGOYLE_TYPE_BOOL && gargoyle_cmp(idx, neg, neg_sz, flags)) { - idx += 3; + idx += neg_sz; } uint8_t end = !*(idx + optv->brand_sz);