============
FS_CreatePath
-Only used for FS_WriteFile.
+Only used for FS_Open.
============
*/
void FS_CreatePath (char *path)
}
else
{
- char* netpath;
-
- netpath = va ("%s/%s", search->filename, name);
+ char netpath[MAX_OSPATH];
+ snprintf(netpath, sizeof(netpath), "%s/%s", search->filename, name);
if (FS_SysFileExists (netpath))
{
if (!quiet)
// Found in the filesystem?
if (i < 0)
- return FS_OpenRead (va ("%s/%s", search->filename, filename), -1, -1);
+ {
+ char netpath[MAX_OSPATH];
+ snprintf(netpath, sizeof(netpath), "%s/%s", search->filename, filename);
+ return FS_OpenRead(netpath, -1, -1);
+ }
// So, we found it in a package...
packfile = &search->pack->files[i];
// If "input" is also empty, we need to fill it
if (ztk->in_ind == ztk->in_max)
{
- size_t remain = file->length - ztk->in_position;
+ size_t remain;
// If we are at the end of the file
- if (!remain)
+ if (ztk->out_position == ztk->real_length)
return nb;
+ remain = file->length - ztk->in_position;
count = (remain > sizeof (ztk->input)) ? sizeof (ztk->input) : remain;
fread (ztk->input, 1, count, file->stream);