Skip to content
Myr

changed buffer to path for STB_EXT_NO_PERIOD, and specified appropriate buffer size for the copy (sizeof(buffer) referred to the size of the buffer pointer, which was incorrect)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Brian Collins · committed by Brian Collins · parent f67165c · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:stb.h+2 added-2 removed
2437 unmodified lines
2438 x = f1;2439 } else {2440 x = f2;2441 if (flag & STB_EXT_NO_PERIOD)2442 if (buffer[x] == '.')2442 if (path[x] == '.')2443 ++x;2444 }24452446 if (flag & STB_EXT)
8 unmodified lines
2455 if (!buffer) return NULL;2456 }24572458 if (len) { stb_p_strcpy_s(buffer, sizeof(buffer), "./"); return buffer; }2459 stb_p_strncpy_s(buffer, sizeof(buffer),path+x, y-x);2459 stb_p_strncpy_s(buffer, y-x+1, path+x, y-x);2460 buffer[y-x] = 0;2461 return buffer;2462}2463
11990 unmodified lines