FRONTPANEL: Fix Coverity identified issues

This commit is contained in:
Mark Pizzolato 2017-03-18 02:17:35 -07:00
parent 0f41c24cb8
commit 5fb61c83e3

View file

@ -1943,9 +1943,9 @@ while ((p->sock != INVALID_SOCKET) &&
data = strtoull (e, NULL, 16); data = strtoull (e, NULL, 16);
if (little_endian) if (little_endian)
memcpy (p->regs[i].addr, &data, p->regs[i].size); memcpy (r->addr, &data, r->size);
else else
memcpy (p->regs[i].addr, ((char *)&data) + sizeof(data)-p->regs[i].size, p->regs[i].size); memcpy (r->addr, ((char *)&data) + sizeof(data)-r->size, r->size);
r = NULL; r = NULL;
} }
s = eol; s = eol;
@ -2138,6 +2138,7 @@ while ((p->sock != INVALID_SOCKET) &&
for (c = strchr (repeat, '\r'); c != NULL; c = strchr (c, '\r')) for (c = strchr (repeat, '\r'); c != NULL; c = strchr (c, '\r'))
*c = ';'; /* replace carriage returns with semicolons */ *c = ';'; /* replace carriage returns with semicolons */
c = strstr (repeat, register_get_echo); /* remove register_done_echo string and */ c = strstr (repeat, register_get_echo); /* remove register_done_echo string and */
if (c) /* always true */
strcpy (c, register_repeat_echo); /* replace it with the register_repeat_echo string */ strcpy (c, register_repeat_echo); /* replace it with the register_repeat_echo string */
if (_panel_sendf (p, &cmd_stat, NULL, "%s", repeat)) { if (_panel_sendf (p, &cmd_stat, NULL, "%s", repeat)) {
pthread_mutex_lock (&p->io_lock); pthread_mutex_lock (&p->io_lock);