Fix some issues found in Coverity scan.

This commit is contained in:
Tomas Mraz
2018-10-10 12:22:04 +02:00
parent 6bf2d74dfc
commit fb97da1ce1
3 changed files with 5 additions and 6 deletions

View File

@@ -50,7 +50,7 @@ static bool is_listed (const char *cfgin, const char *tty, bool def);
static bool is_listed (const char *cfgin, const char *tty, bool def)
{
FILE *fp;
char buf[200], *s;
char buf[1024], *s;
const char *cons;
/*
@@ -70,7 +70,8 @@ static bool is_listed (const char *cfgin, const char *tty, bool def)
if (*cons != '/') {
char *pbuf;
strcpy (buf, cons);
strncpy (buf, cons, sizeof (buf));
buf[sizeof (buf) - 1] = '\0';
pbuf = &buf[0];
while ((s = strtok (pbuf, ":")) != NULL) {
if (strcmp (s, tty) == 0) {