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 {
|
} else {
|
||||||
x = f2;
|
x = f2;
|
||||||
if (flag & STB_EXT_NO_PERIOD)
|
if (flag & STB_EXT_NO_PERIOD)
|
||||||
if (buffer[x] == '.')
|
if (path[x] == '.')
|
||||||
++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; }
|
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;
|
buffer[y-x] = 0;
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user