Skip to content

Commit

Permalink
Merge branch 'splitpath_raw_fix' of https://github.com/bcollins526/stb
Browse files Browse the repository at this point in the history
…into work2
  • Loading branch information
Sean Barrett committed Feb 2, 2020
2 parents aad77ec + d5d052c commit d256911
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stb.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ CREDITS
github:infatum
Dave Butler (Croepha)
Ethan Lee (flibitijibibo)
Brian Collins
*/

#include <stdarg.h>
Expand Down Expand Up @@ -2006,7 +2007,7 @@ char *stb_trimwhite(char *s)
char *stb_strncpy(char *s, char *t, int n)
{
stb_p_strncpy_s(s,n+1,t,n);
s[n-1] = 0;
s[n] = 0;
return s;
}

Expand Down Expand Up @@ -2437,7 +2438,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;
}

Expand All @@ -2454,8 +2455,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);
buffer[y-x] = 0;
stb_strncpy(buffer, path+int(x), int(y-x));
return buffer;
}

Expand Down

0 comments on commit d256911

Please sign in to comment.