Consider the following code that illustrates the issue:
#include <stdio.h>
#include <stdlib.h>
#include <bstrlib.h>
int main(void) {
int i;
bstring haystack = bfromcstr("aXXXXb");
bstring needle = bfromcstr("XX");
struct bstrList *xs = bsplitstr(haystack, needle);
printf("Number of elements: %d\n", xs->qty);
for(i = 0; i < xs->qty; i++) {
printf("#%d: %s\n", i, xs->entry[i]->data);
}
bstrListDestroy(xs);
bdestroy(haystack);
bdestroy(needle);
return 0;
}
The output is:
Number of elements: 2
#0: a
#1: XXb
This bug was pointed out by Claude Opus 4.8. The conversation is attached.
claude.md
Consider the following code that illustrates the issue:
The output is:
This bug was pointed out by Claude Opus 4.8. The conversation is attached.
claude.md