My program was not behaving correctly on one machine so I started to hunt for the bug, and I discovered that on that machine, snprintf uses a comma (,), not a . (dot) as 99% of
. versus , is set by the LC_NUMERIC part of the locale. So make sure you set your program to use a locale that uses the . (such as "POSIX").
.
,
LC_NUMERIC
"POSIX"