use snprintf in unix/system

This commit is contained in:
Denis Pauk 2020-01-26 22:11:28 +02:00
parent fae078745f
commit 9f2f249aaa

View file

@ -278,7 +278,7 @@ Sys_FindFirst(char *path, unsigned musthave, unsigned canhave)
{ {
if ((strcmp(d->d_name, ".") != 0) || (strcmp(d->d_name, "..") != 0)) if ((strcmp(d->d_name, ".") != 0) || (strcmp(d->d_name, "..") != 0))
{ {
sprintf(findpath, "%s/%s", findbase, d->d_name); snprintf(findpath, sizeof(findpath), "%s/%s", findbase, d->d_name);
return findpath; return findpath;
} }
} }
@ -303,7 +303,7 @@ Sys_FindNext(unsigned musthave, unsigned canhave)
{ {
if ((strcmp(d->d_name, ".") != 0) || (strcmp(d->d_name, "..") != 0)) if ((strcmp(d->d_name, ".") != 0) || (strcmp(d->d_name, "..") != 0))
{ {
sprintf(findpath, "%s/%s", findbase, d->d_name); snprintf(findpath, sizeof(findpath), "%s/%s", findbase, d->d_name);
return findpath; return findpath;
} }
} }