clach04 committed f4a1c82 Draft

Windows NT batch file creation code in execcmd() was not checking for file open failures, log errors and exit if this happens.
NOTE it is not clear to me if execnt.c is used anymore, a similar change is needed there (or execnt.c should be removed).

Comments (0)

Files changed (1)

 	    /* Write command to bat file. */
 	    f = fopen( cmdtab[ slot ].tempfile, "w" );
+	    if (f == NULL)
+	    {
+	        printf("Unable to open file %s for writing, errno = %d", cmdtab[ slot ].tempfile, errno);
+	        exit(EXITBAD);
+	    }
 	    fputs( string, f );
 	    fclose( f );