1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00

Avoid uninitialized variable

This commit is contained in:
Carles Fernandez 2018-05-19 17:08:13 +02:00
parent eeb2893f9c
commit 0f4306d0d9
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -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;