Repository navigation
Commit f522219
authored
fix(string): avoid empty-pattern loop (#141)
An empty search pattern never advances either strstr loop. Treat it as a successful no-op, matching the existing no-match behavior.
Confidence: high
Scope-risk: narrow
Tested: official sc_str CMake test with ASan; GCC 13 ASan/UBSan; MinGW GCC 8
Not-tested: MSVC1 parent d0f6a80 commit f522219
2 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
370 | 374 | | |
371 | 375 | | |
372 | 376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
462 | 467 | | |
463 | 468 | | |
464 | 469 | | |
| |||
0 commit comments