From 0f4306d0d923ce11f7bc215b7b94bff202a69cf9 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 17:08:13 +0200 Subject: [PATCH] Avoid uninitialized variable --- src/algorithms/libs/rtklib/rtklib_stream.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 4e6f0a0a1..75b576efc 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -120,8 +120,7 @@ serial_t *openserial(const char *path, int mode, char *msg) std::string s_aux = "/dev/" + std::string(port); s_aux.resize(128, '\0'); int n = s_aux.length(); - if (n < 128) - for (int i = 0; i < n; i++) dev[i] = s_aux[i]; + for (int i = 0; i < n; i++) dev[i] = s_aux[i]; if ((mode & STR_MODE_R) && (mode & STR_MODE_W)) rw = O_RDWR;