From cfd056bea1da3fb8c166a615ee3a97a831491469 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 25 Nov 2013 10:36:15 +0000 Subject: Fix rotten Windows port. --- src/lib/cfuns-c.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c index cac76b6c..c5d5c870 100644 --- a/src/lib/cfuns-c.c +++ b/src/lib/cfuns-c.c @@ -492,8 +492,9 @@ oa_acquire_temporary_pathname() { #if OPENAXIOM_MS_WINDOWS_HOST char buf[MAX_PATH]; const char* tmpdir = oa_get_tmpdir(); - auto n = GetTempFileName(tmpdir, "oa-", rand() % SHORT_MAX, buf); - free(tmpdir); + auto n = GetTempFileName(tmpdir, "oa-", rand() % SHRT_MAX, buf); + /* tmpdir was malloc()ed when OPENAXIOM_MS_WINDOWS_HOST. */ + free(const_cast(tmpdir)); if (n == 0) { perror("oa_acquire_temporary_pathname"); exit(1); @@ -816,7 +817,7 @@ oa_spawn(Process* proc, SpawnFlags flags) } cmd_line[curpos] = '\0'; - if ((flags & spawn_search_path) == 0) + if ((flags & SpawnFlags::search_path) == 0) path = proc->argv[0]; if(CreateProcess(/* lpApplicationName */ path, @@ -833,7 +834,7 @@ oa_spawn(Process* proc, SpawnFlags flags) return proc->id = -1; } proc->id = proc_info.dwProcessId; - if ((flags & spawn_replace) == 0) + if ((flags & SpawnFlags::replace) == 0) return proc->id; WaitForSingleObject(proc_info.hProcess, INFINITE); GetExitCodeProcess(proc_info.hProcess, &status); -- cgit v1.2.3