Delete nonsensical comment from lib/tag.c
The length-bounded strchr(3) is called memchr(3), not "strnchr", but
using that wouldn't accomplish anything useful for the code under
this comment.
Perhaps the original author meant (hypothetically) "strncspn" or
"memcspn", which may be useful, but would barely be any better than
the current loop-and-switch implementation.
@@ -192,17 +192,16 @@ void gumbo_tag_from_original_text(GumboStringPiece* text) {
assert(text->length >= 2);
assert(text->data[0] == '<');
assert(text->data[text->length - 1] == '>');
+
if (text->data[1] == '/') {
- // End tag.
+ // End tag
assert(text->length >= 3);
text->data += 2; // Move past </
text->length -= 3;
} else {
- // Start tag.
+ // Start tag
text->data += 1; // Move past <
text->length -= 2;
- // strnchr is apparently not a standard C library function, so I loop
- // explicitly looking for whitespace or other illegal tag characters.
for (const char* c = text->data; c != text->data + text->length; ++c) {
switch (*c) {
case '\t':
