Fixed OICMiddle compile-time warnings regarding potential use of an
uninitialized variable, as well as an ignored getline() result.
Change-Id: I6ce5a7212ea87cfc506cc97ca97a873c308bf17c
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/955
Reviewed-by: John Light <john.j.light@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
while (true) {
fputs(">", stdout);
len = 0;
- getline(&line, &len, stdin);
- int n = strlen(line);
- if (!n)
+ const ssize_t n = getline(&line, &len, stdin);
+ if (n <= 0)
continue;
if (m_observer) {
m_observer->cancelObserve();
LineResult LineInput::parseLine(string lineIn, elements_t& elems)
{
const char *d;
- char c, *e, delim;
+ char c, *e, delim = 0;
bool isSep1, isSep2;
size_t len = lineIn.size();
ParseState state = PS_Between;