better init for random number generator
[xboard.git] / winboard / help.c
index a8cebd6..d10f9ab 100644 (file)
@@ -24,6 +24,7 @@
 \r
 #include <windows.h>\r
 #include <stdio.h>\r
+#include "help.h"
 \r
 FILE *debugFP;\r
 \r
@@ -62,7 +63,7 @@ HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD_PTR data )
        sprintf(buf, "Hh.exe %s", helpFile);\r
 \r
        // ignore the other parameters; just start the viewer with the help file\r
-       return CreateProcess(NULL,\r
+       if(  CreateProcess(NULL,\r
                           buf,            /* command line */\r
                           NULL,           /* process security attributes */\r
                           NULL,           /* primary thread security attrs */\r
@@ -71,7 +72,8 @@ HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD_PTR data )
                           NULL,           /* use parent's environment */\r
                           NULL,\r
                           &siStartInfo,   /* STARTUPINFO pointer */\r
-                          &helpProcInfo); /* receives PROCESS_INFORMATION */\r
+                          &helpProcInfo)  /* receives PROCESS_INFORMATION */\r
+               ) return hwnd; else return NULL;\r
 }\r
 \r
 //HWND WINAPI\r
@@ -81,13 +83,13 @@ MyHelp(HWND hwnd, LPSTR helpFile, UINT action, DWORD_PTR data)
        static int status = 0;\r
        FILE *f;\r
 \r
-       if(status < 0) return NULL;\r
+       if(status < 0) return 0;\r
 \r
        if(!status) {\r
                f = fopen(helpFile, "r");\r
                if(f == NULL) {\r
                        status = -1;\r
-                       return NULL;\r
+                       return 0;\r
                }\r
                status = 1;\r
                fclose(f);\r