LibExprParser::copyInput warning

This commit is contained in:
James Cherry 2020-09-25 16:09:26 -07:00
parent 6deaf6d8fc
commit 2c0e653dc1
1 changed files with 4 additions and 9 deletions

View File

@ -128,15 +128,10 @@ size_t
LibExprParser::copyInput(char *buf,
size_t max_size)
{
size_t length = strlen(func_);
if (length == 0)
return 0;
else {
size_t count = std::min(length, max_size);
strncpy(buf, func_, count);
func_ += count;
return count;
}
strncpy(buf, func_, max_size);
int count = strlen(buf);
func_ += count;
return count;
}
char *