on master help sign in
Merge pull request #331 from ygale/whl-msvcrt

wai-handler-launch cannot be loaded dynamically on 64 bit Windows

commit48ee14d020ce8d76792f48bec1cea18a99e0f51c authorMichael Snoyman <michael@snoyman.com> dateThu 29 Jan 2015, 06:10 (12 years ago) parent169ef6e2f732a0
2 files changed+2−2
wai-handler-launch/wai-handler-launch.cabal+1−1 wai-handler-launch/windows.c+1−1
wai-handler-launch/wai-handler-launch.cabal+1−1
@@ -25,7 +25,7 @@ Library
2525 if os(windows)
2626 c-sources: windows.c
2727 cpp-options: -DWINDOWS
28− extra-libraries: Shell32
28+ extra-libraries: Shell32 msvcrt
2929 else
3030 build-depends: process >= 1.0 && < 1.3
3131 if os(darwin)
wai-handler-launch/windows.c+1−1
@@ -6,7 +6,7 @@ void launch(int port, char *s)
66{
77 int len = 8 + strlen("http://127.0.0.1:") + strlen(s);
88 char *buff = malloc(len);
9− snprintf(buff, len, "http://127.0.0.1:%d/%s", port, s);
9+ _snprintf(buff, len, "http://127.0.0.1:%d/%s", port, s);
1010 ShellExecute(NULL, "open", buff, NULL, NULL, SW_SHOWNORMAL);
1111 free(buff);
1212}