diff --git a/jtag/ChangeLog b/jtag/ChangeLog index a3262b7b..a6f40eca 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,7 @@ +2003-08-26 Marcel Telka + + * src/cmd/print.c (cmd_print_run): Fixed header print format. + 2003-08-25 Marcel Telka * configure.ac (AC_INIT): Changed package name. diff --git a/jtag/NEWS b/jtag/NEWS index d1f1fc29..58764192 100644 --- a/jtag/NEWS +++ b/jtag/NEWS @@ -7,6 +7,7 @@ See libbrux/NEWS for more news. - Altera EPM7128AETC100 (Rojhalat Ibrahim) * Added additional checks for valid ByteBlaster cable connection and enabled all variants of the cable (patch 793313, Rojhalat Ibrahim). + * Fixed minor bugs. jtag-0.5 (2003-08-19): diff --git a/jtag/src/cmd/print.c b/jtag/src/cmd/print.c index 664654fd..8d685fe6 100644 --- a/jtag/src/cmd/print.c +++ b/jtag/src/cmd/print.c @@ -24,8 +24,10 @@ #include "sysdep.h" +#include #include #include +#include #include "part.h" #include "jtag.h" @@ -36,6 +38,8 @@ static int cmd_print_run( char *params[] ) { char format[100]; + wchar_t wformat[100]; + wchar_t wheader[100]; char header[100]; int i; int noheader = 0; @@ -61,10 +65,14 @@ cmd_print_run( char *params[] ) if (noheader == 0) { snprintf( format, 100, _(" No. %%-%ds %%-%ds %%-%ds %%-%ds %%-%ds\n"), MAXLEN_MANUFACTURER, MAXLEN_PART, MAXLEN_STEPPING, MAXLEN_INSTRUCTION, MAXLEN_DATA_REGISTER ); - snprintf( header, 100, format, _("Manufacturer"), _("Part"), _("Stepping"), _("Instruction"), _("Register") ); + if (mbstowcs( wformat, format, 100 ) == -1) + printf( _("(%d) String conversion failed!\n"), __LINE__ ); + swprintf( wheader, 100, wformat, _("Manufacturer"), _("Part"), _("Stepping"), _("Instruction"), _("Register") ); + if (wcstombs( header, wheader, 100 ) == -1) + printf( _("(%d) String conversion failed!\n"), __LINE__ ); printf( header ); - for (i = 0; i < strlen( header ); i++ ) + for (i = 0; i < wcslen( wheader ); i++ ) putchar( '-' ); putchar( '\n' ); }