summaryrefslogtreecommitdiff
path: root/tests/constitute.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/constitute.c')
-rw-r--r--tests/constitute.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/constitute.c b/tests/constitute.c
index 5a36096..be0888d 100644
--- a/tests/constitute.c
+++ b/tests/constitute.c
@@ -17,6 +17,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <locale.h>
int main ( int argc, char **argv )
{
@@ -56,6 +57,17 @@ int main ( int argc, char **argv )
StorageType
storage_type=CharPixel;
+ /*
+ 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("constitute",argv[0],7) == 0)
InitializeMagick((char *) NULL);
else
@@ -165,10 +177,10 @@ int main ( int argc, char **argv )
goto program_exit;
}
- (void) strncpy(infile, argv[arg], MaxTextExtent );
+ (void) strncpy(infile, argv[arg], MaxTextExtent-1 );
infile[MaxTextExtent-1]='\0';
arg++;
- (void) strncpy( map, argv[arg], MaxTextExtent );
+ (void) strncpy( map, argv[arg], MaxTextExtent-1 );
map[MaxTextExtent-1]='\0';
/* for (arg=0; arg < argc; arg++) */