We ported from UNIX to LINUX and one of our programs has stopped working as expected. the problem appears to be a comma in a numeric field where one did not appear under UNIX. This is a Pro-C application but I am hoping someone will know what is happening. I have included the code in question below and a sample of the output we are seeing.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
staticvoid print_slk_value(int irow, int icol, TMCHAR *val);
.
.
.
staticvoid print_slk_value(int irow, int icol, TMCHAR *val) {
static TMCHAR slktmp[200]={0};
static TMCHAR stmp[30]={0};
slk_row = irow;
slk_col = icol-1;
tmstrcpy(slktmp,_TMC("C;"));
/* This line causes the problem with the comma in a row number*/
tmsprintf(&tmBundle, stmp,_TMC("Y{0,number,integer};"),slk_row);
tmstrcat(slktmp,stmp);
print_slkvalfini(slktmp, val);
OUTPUT:
C;Y1,000;X1;K"397259"
We never had the comma after the Y1 when running in UNIX.
I suspect it is a locale problem. Linux systems are typically more correct when it comes to playing with the locale than Unix systems. You need to figure out how to reset the locale (in your program) back to the one you want before doing printf() variants.
You can do this either as part of the shell startup when spawning your program, or in program code.