diff options
Diffstat (limited to 'tests/drawtest.c')
-rw-r--r-- | tests/drawtest.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/drawtest.c b/tests/drawtest.c index 47e6b9a..eca3bb8 100644 --- a/tests/drawtest.c +++ b/tests/drawtest.c @@ -10,6 +10,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <locale.h> #if !defined(True) # define True 1 @@ -359,9 +360,20 @@ int main ( int argc, char **argv ) exit( 1 ); } - (void) strncpy( outfile, argv[1], MaxTextExtent); + (void) strncpy( outfile, argv[1], MaxTextExtent-1); outfile[MaxTextExtent-1]='\0'; + /* + Initialize locale from environment variables (LANG, LC_CTYPE, + LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, + LC_ALL), but require that LC_NUMERIC use common conventions. The + LC_NUMERIC variable affects the decimal point character and + thousands separator character for the formatted input/output + functions and string conversion functions. + */ + (void) setlocale(LC_ALL,""); + (void) setlocale(LC_NUMERIC,"C"); + if (LocaleNCompare("drawtest",argv[0],7) == 0) InitializeMagick((char *) NULL); else |