replace non-thread-safe functions

replace all uses of strtok, localtime, gmtime and readdir

on platforms without safe versions, use homebrew or unsafe...
This commit is contained in:
ac-stef
2016-02-28 23:14:47 +01:00
parent 98d01d1f34
commit 32ffd3a4cd
11 changed files with 60 additions and 38 deletions
+3 -3
View File
@@ -454,12 +454,12 @@ void loadhistory()
{
char *histbuf = loadfile(path("config/history", true), NULL);
if(!histbuf) return;
char *line = NULL;
line = strtok(histbuf, "\n");
char *line = NULL, *b;
line = strtok_r(histbuf, "\n", &b);
while(line)
{
history.add(new hline)->buf = newstring(line);
line = strtok(NULL, "\n");
line = strtok_r(NULL, "\n", &b);
}
DELETEA(histbuf);
histpos = history.length();