From 114e7735b961720e63d2145770ed9b82c0200ff8 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 31 Dec 2014 16:46:50 -0800 Subject: Call setlocale() before getting version information. That way, the setlocale() call used to get the current locale will get the right answer. Change-Id: Ib43e16a9d98d08e5ddaff81fd3235f5b64d7b95b Reviewed-on: https://code.wireshark.org/review/6197 Reviewed-by: Guy Harris --- rawshark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rawshark.c') diff --git a/rawshark.c b/rawshark.c index 8859054053..5bbdaa04d9 100644 --- a/rawshark.c +++ b/rawshark.c @@ -450,6 +450,9 @@ main(int argc, char *argv[]) static const char optstring[] = OPTSTRING_INIT; + /* Set the C-language locale to the native environment. */ + setlocale(LC_ALL, ""); + cmdarg_err_init(rawshark_cmdarg_err, rawshark_cmdarg_err_cont); /* Get the compile-time version information string */ @@ -530,9 +533,6 @@ main(int argc, char *argv[]) case any dissectors register preferences. */ epan_init(register_all_protocols, register_all_protocol_handoffs, NULL, NULL); - /* Set the C-language locale to the native environment. */ - setlocale(LC_ALL, ""); - prefs_p = read_prefs(&gpf_open_errno, &gpf_read_errno, &gpf_path, &pf_open_errno, &pf_read_errno, &pf_path); if (gpf_path != NULL) { -- cgit v1.2.3