on master help sign in
Merge pull request #331 from ygale/whl-msvcrt
48ee14dMichael Snoyman
wai-handler-launch/wai-handler-launch.cabal+1−1
@@ -25,7 +25,7 @@ Library
25 if os(windows)
25 if os(windows)
26 c-sources: windows.c
26 c-sources: windows.c
27 cpp-options: -DWINDOWS
27 cpp-options: -DWINDOWS
28− extra-libraries: Shell32
28+ extra-libraries: Shell32 msvcrt
29 else
29 else
30 build-depends: process >= 1.0 && < 1.3
30 build-depends: process >= 1.0 && < 1.3
31 if os(darwin)
31 if os(darwin)
wai-handler-launch/windows.c+1−1
@@ -6,7 +6,7 @@ void launch(int port, char *s)
6{
6{
7 int len = 8 + strlen("http://127.0.0.1:") + strlen(s);
7 int len = 8 + strlen("http://127.0.0.1:") + strlen(s);
8 char *buff = malloc(len);
8 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);
10 ShellExecute(NULL, "open", buff, NULL, NULL, SW_SHOWNORMAL);
10 ShellExecute(NULL, "open", buff, NULL, NULL, SW_SHOWNORMAL);
11 free(buff);
11 free(buff);
12}
12}