From db84b13884cf8d0164e04981f916a405de83fe52 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 1 Sep 2019 23:33:19 -0400 Subject: [PATCH] tweak --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 75d1233..9919c1d 100644 --- a/README.md +++ b/README.md @@ -39,12 +39,14 @@ This will generate a function (`int match(const char *)`) which is essentially: ``` int match(const char *cp) { - if (!strncasecmp(cp, "abcd\x00", 5)) return (2 << 8) | 4; - if (!strncasecmp(cp, "abc\x00", 4)) return (1 << 8) | 3; + if (!strncasecmp(cp, "abcd", 4)) return (2 << 8) | 4; + if (!strncasecmp(cp, "abc", 3)) return (1 << 8) | 3; return 0; } ``` +(without the `-c` flag it would be more akin to `memcmp` than `strcmp`) + But hopefully more efficient... ```