From 2b7ccc11b9682cafd8804ae28030ae8c2cbb7574 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 19 May 2018 20:42:50 +0200 Subject: [PATCH] Make Coverity Scan happy --- src/algorithms/libs/rtklib/rtklib_stream.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 75b576efc..feba27b10 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -121,6 +121,7 @@ serial_t *openserial(const char *path, int mode, char *msg) s_aux.resize(128, '\0'); int n = s_aux.length(); for (int i = 0; i < n; i++) dev[i] = s_aux[i]; + if (n == 0) dev[0] = '\0'; if ((mode & STR_MODE_R) && (mode & STR_MODE_W)) rw = O_RDWR;