mirror of
https://github.com/nothings/stb
synced 2024-12-15 20:32:33 +03:00
better to just use stb_strncpy inside stb__splitpath_raw, also fixed an indexing bug in stb_strncpy itself.
This commit is contained in:
parent
7c44b15903
commit
8fca192660
5
stb.h
5
stb.h
@ -2009,7 +2009,7 @@ char *stb_trimwhite(char *s)
|
|||||||
char *stb_strncpy(char *s, char *t, int n)
|
char *stb_strncpy(char *s, char *t, int n)
|
||||||
{
|
{
|
||||||
stb_p_strncpy_s(s,n+1,t,n);
|
stb_p_strncpy_s(s,n+1,t,n);
|
||||||
s[n-1] = 0;
|
s[n] = 0;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2457,8 +2457,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, y-x+1, path+x, y-x);
|
stb_strncpy(buffer, path+x, y-x);
|
||||||
buffer[y-x] = 0;
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user