aboutsummaryrefslogtreecommitdiffstats
path: root/tests/emu
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-04 09:34:00 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-04 10:02:01 +0200
commit0494c75a53f05a5ec4c4b3830672ef2451396f27 (patch)
treeb0564775d1e58aede32fbb0598ad25bde85277be /tests/emu
parent0d39dc92b5cfe6e8be9b2a68eaf50c94cae97355 (diff)
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
Diffstat (limited to 'tests/emu')
-rw-r--r--tests/emu/pcu_emu.cpp4
1 files changed, 3 insertions, 1 deletions
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 <sys/types.h>
#include <sys/socket.h>
-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);