Linux causing a problem

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
 static void print_slk_value(int irow, int icol, TMCHAR *val);
.
.
.
static void 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.

Any help would be appreciated.

Thanks,
Mike
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.

Hope this helps.
Duoas,

Thanks for your answer. I am not sure I understand. when you say locale, where would I find these?

Thanks,
Mike
What does command
locale
show?

You could try to set
LANG=C
for the shell session. At some point the initscripts did so too, because system-default UTF was slow.
Topic archived. No new replies allowed.