1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-09-18 11:06:53 +02:00

fix potential race conditions

This commit is contained in:
Jfreegman
2014-07-09 00:05:13 -04:00
parent f98c77432b
commit 1ce731471d
9 changed files with 31 additions and 27 deletions

View File

@@ -194,7 +194,7 @@ int valid_nick(char *nick)
}
/* gets base file name from path or original file name if no path is supplied */
void get_file_name(char *namebuf, const char *pathname)
void get_file_name(char *namebuf, int bufsize, const char *pathname)
{
int idx = strlen(pathname) - 1;
@@ -213,7 +213,7 @@ void get_file_name(char *namebuf, const char *pathname)
filename = tmpname;
}
snprintf(namebuf, sizeof(namebuf), "%s", filename);
snprintf(namebuf, bufsize, "%s", filename);
}
/* converts str to all lowercase */