Commit 1a61a03b authored by Alexandre Julliard's avatar Alexandre Julliard

Bug fixes.

parent 08afc1a5
...@@ -122,7 +122,7 @@ int insert_hex (char * infile, FILE * outfile) ...@@ -122,7 +122,7 @@ int insert_hex (char * infile, FILE * outfile)
if (++i >= st.st_size) break; if (++i >= st.st_size) break;
fprintf(outfile, "%s", (i == (i & 0xfffffff0)) ? "'\n '" :" "); fprintf(outfile, "%s", (i == (i & 0xfffffff0)) ? "'\n '" :" ");
} }
fprintf (outfile, "'\n}\n"); fprintf (outfile, "'\n}");
munmap(p_in_file, st.st_size); munmap(p_in_file, st.st_size);
close(fd); close(fd);
return 1; return 1;
...@@ -141,7 +141,9 @@ int convert_to_res () ...@@ -141,7 +141,9 @@ int convert_to_res ()
time_t tinput; time_t tinput;
long startpos, endpos; long startpos, endpos;
tmpnam(tmpfile); strcpy( tmpfile, g_lpstrInputFile );
strcat( tmpfile, "-tmp" );
/* FIXME: should use better tmp name and create with O_EXCL */
if( (ftemp = fopen( tmpfile, "w")) == NULL ) goto error_open_file; if( (ftemp = fopen( tmpfile, "w")) == NULL ) goto error_open_file;
if( (fin = fopen( g_lpstrInputFile, "r")) == NULL || stat(g_lpstrInputFile, &st)) goto error_open_file; if( (fin = fopen( g_lpstrInputFile, "r")) == NULL || stat(g_lpstrInputFile, &st)) goto error_open_file;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment