From 0494c75a53f05a5ec4c4b3830672ef2451396f27 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Mon, 4 May 2015 09:34:00 +0200 Subject: pcu_emu/test: Initialise current_test Currently the global current_test is not initialised, which leads to memory access failures. In addition, the variable is signed but used in comparisons with unsigned values. This commit changes the type to size_t and initialises the variable to 0. Sponsored-by: On-Waves ehf --- tests/emu/pcu_emu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/emu') diff --git a/tests/emu/pcu_emu.cpp b/tests/emu/pcu_emu.cpp index 3dfa64dc..3725c8d9 100644 --- a/tests/emu/pcu_emu.cpp +++ b/tests/emu/pcu_emu.cpp @@ -35,7 +35,7 @@ extern "C" { #include #include -static int current_test; +static size_t current_test; /* Extern data to please the underlying code */ void *tall_pcu_ctx; @@ -115,6 +115,8 @@ int main(int argc, char **argv) vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); + current_test = 0; + init_main_bts(); create_and_connect_bssgp(bts_main_data(), INADDR_LOOPBACK, 23000); -- cgit v1.2.3