Add "b" to the fopen() mode string for Windows and such [2874517] by Daryl Tester

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1812 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Mike Frysinger 15 years ago
parent 473f535350
commit c483d516d6

@ -6,6 +6,11 @@
* src/apps/jtag/jtag.c: Unify jtag home dir parsing and add support for
the Windows home env var names.
* src/apps/bsdl2jtag/bsdl2jtag.c, src/bsdl/bsdl.c, src/bsdl/vhdl_flex.l,
src/cmd/cmd_readmem.c, src/cmd/cmd_svf.c, src/cmd/cmd_writemem.c,
src/global/parse.c, src/tap/detect.c: Add "b" to the fopen() mode string
for Windows and such [2874517] by Daryl Tester.
2010-06-29 Mike Frysinger <vapier@gentoo.org>
* src/tap/cable/generic_usbconn_list.h: Macro away duplicate ftdi lists.

@ -80,7 +80,7 @@ main (int argc, char *const argv[])
return 1;
}
jtag_file = fopen (argv[2], "w");
jtag_file = fopen (argv[2], "wb");
if (jtag_file == NULL)
{
printf ("Error: Can't open '%s' in write mode.\n", argv[2]);

@ -112,7 +112,7 @@ urj_bsdl_read_file (urj_chain_t *chain, const char *BSDL_File_Name,
jtag_ctrl.part = NULL;
}
BSDL_File = fopen (BSDL_File_Name, "r");
BSDL_File = fopen (BSDL_File_Name, "rb");
urj_bsdl_msg (proc_mode, _("Reading file '%s'\n"), BSDL_File_Name);

@ -501,7 +501,7 @@ urj_vhdl_flex_switch_file (yyscan_t scanner, char *filename)
extra = yyget_extra (scanner);
/* file in current directory has precedence */
f = fopen (filename, "r");
f = fopen (filename, "rb");
if (!f)
{
const char *db_path = urj_get_data_dir ();
@ -518,7 +518,7 @@ urj_vhdl_flex_switch_file (yyscan_t scanner, char *filename)
strcat (db_file, "bsdl");
strcat (db_file, "/");
strcat (db_file, filename);
f = fopen (db_file, "r");
f = fopen (db_file, "rb");
if (!f)
urj_bsdl_ftl_set (extra->proc_mode, URJ_ERROR_IO,

@ -62,7 +62,7 @@ cmd_readmem_run (urj_chain_t *chain, char *params[])
|| urj_cmd_get_number (params[2], &len) != URJ_STATUS_OK)
return URJ_STATUS_FAIL;
f = fopen (params[3], "w");
f = fopen (params[3], "wb");
if (!f)
{
urj_error_IO_set (_("Unable to create file `%s'"), params[3]);

@ -78,7 +78,7 @@ cmd_svf_run (urj_chain_t *chain, char *params[])
if (print_progress)
urj_log_state.level = URJ_LOG_LEVEL_DETAIL;
if ((SVF_FILE = fopen (params[1], "r")) != NULL)
if ((SVF_FILE = fopen (params[1], "rb")) != NULL)
{
result = urj_svf_run (chain, SVF_FILE, stop, ref_freq);

@ -60,7 +60,7 @@ cmd_writemem_run (urj_chain_t *chain, char *params[])
|| urj_cmd_get_number (params[2], &len) != URJ_STATUS_OK)
return URJ_STATUS_FAIL;
f = fopen (params[3], "r");
f = fopen (params[3], "rb");
if (!f)
{
urj_error_IO_set (_("Unable to open file `%s'"), params[3]);

@ -202,7 +202,7 @@ urj_parse_file (urj_log_level_t ll, urj_chain_t *chain, const char *filename)
FILE *f;
int go;
f = fopen (filename, "r");
f = fopen (filename, "rb");
if (!f)
{
urj_error_IO_set ("Cannot open file '%s' to parse", filename);

@ -59,7 +59,7 @@ find_record (char *filename, urj_tap_register_t *key, struct id_record *idr)
urj_tap_register_t *tr;
int r = 0;
file = fopen (filename, "r");
file = fopen (filename, "rb");
if (!file)
{
urj_log (URJ_LOG_LEVEL_ERROR, _("Unable to open file '%s'\n"), filename);

Loading…
Cancel
Save