Jinoh Kang (@iamahuman) commented about dlls/comctl32/commctrl.c:
static int CALLBACK PathWordBreakProc(LPCWSTR lpch, int ichCurrent, int cch, int code) {
- if (code == WB_ISDELIMITER)
return IsDelimiter(lpch[ichCurrent]);
- else
- {
int dir = (code == WB_LEFT) ? -1 : 1;
for(; 0 <= ichCurrent && ichCurrent < cch; ichCurrent += dir)
if (IsDelimiter(lpch[ichCurrent])) return ichCurrent;
- INT ret = 0;
- switch (code) {
case WB_LEFT:
if (!lpch || ichCurrent < 0 || ichCurrent > cch)
The `ichCurrent < 0` case is not tested. Assuming it triggers undefined behaviour on Windows, it's hard to add working tests for it. Since this code is untested, you should just remove the `ichCurrent < 0`. Maybe add `assert(ichCurrent < 0);` if you're genuinely worried.