aboutsummaryrefslogtreecommitdiffstats
path: root/src/tvtimeconf.c
diff options
context:
space:
mode:
authorvektor <devnull@localhost>2004-10-21 03:28:30 +0000
committervektor <devnull@localhost>2004-10-21 03:28:30 +0000
commit00fc113bfb538df2c75c4d4bfd144c1062d3ef1b (patch)
tree0afd626f703424bd381375499e157163f4dd0224 /src/tvtimeconf.c
parent094af8aa7f136fe6b25712abe7913a99d6663162 (diff)
20 Oct 2004 Billy Biggs <vektor@dumbterm.net>
* tvtime/src/tvtime.c: Protect the overscan parameter from being written in a locale that likes to use commas instead of periods in floating point numbers. * tvtime/src/tvtimeconf.c: Protect the overscan parameter from being read in a locale that likes to use commas instead of periods in floating point numbers. * tvtime/src/utils.c: Since the overscan parameter is now protected, we don't need to mess up the UI's display of floating point numbers.
Diffstat (limited to 'src/tvtimeconf.c')
-rw-r--r--src/tvtimeconf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tvtimeconf.c b/src/tvtimeconf.c
index 4f35865..0600474 100644
--- a/src/tvtimeconf.c
+++ b/src/tvtimeconf.c
@@ -373,10 +373,18 @@ static void parse_option( config_t *ct, xmlNodePtr node )
}
if( !xmlStrcasecmp( name, BAD_CAST "Overscan" ) ) {
+ char prevloc[ 256 ];
+
+ /* Make sure floating point numbers are always written to
+ * the config file in "C" locale format.
+ */
+ strncpy( prevloc, setlocale( LC_NUMERIC, NULL ), sizeof prevloc );
+ setlocale( LC_NUMERIC, "C" );
ct->overscan = ( atof( curval ) / 2.0 ) / 100.0;
if( !isnormal( ct->overscan ) ) {
ct->overscan = 0.0;
}
+ setlocale( LC_NUMERIC, prevloc );
}
if( !xmlStrcasecmp( name, BAD_CAST "MixerDevice" ) ) {

Privacy Policy