mirror of
https://github.com/nothings/stb
synced 2024-12-15 20:32:33 +03:00
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)
This commit is contained in:
parent
f67165c2bb
commit
41d1dcc029
4
stb.h
4
stb.h
@ -2439,7 +2439,7 @@ static char *stb__splitpath_raw(char *buffer, char *path, int flag)
|
||||
} else {
|
||||
x = f2;
|
||||
if (flag & STB_EXT_NO_PERIOD)
|
||||
if (buffer[x] == '.')
|
||||
if (path[x] == '.')
|
||||
++x;
|
||||
}
|
||||
|
||||
@ -2456,7 +2456,7 @@ static char *stb__splitpath_raw(char *buffer, char *path, int flag)
|
||||
}
|
||||
|
||||
if (len) { stb_p_strcpy_s(buffer, sizeof(buffer), "./"); return buffer; }
|
||||
stb_p_strncpy_s(buffer, sizeof(buffer),path+x, y-x);
|
||||
stb_p_strncpy_s(buffer, y-x+1, path+x, y-x);
|
||||
buffer[y-x] = 0;
|
||||
return buffer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user