compiler warning

This commit is contained in:
James Cherry 2020-07-06 18:35:36 -07:00
parent 875778b25a
commit 7f037334bf
1 changed files with 3 additions and 7 deletions

View File

@ -16,6 +16,7 @@
#include "FuncExpr.hh"
#include <algorithm> // min
#include "Report.hh"
#include "StringUtil.hh"
#include "Liberty.hh"
@ -129,14 +130,9 @@ LibExprParser::copyInput(char *buf,
{
size_t length = strlen(func_);
if (length == 0)
return 0;
return 0;
else {
size_t count;
if (length < max_size)
count = length;
else
count = max_size;
size_t count = std::min(length, max_size);
strncpy(buf, func_, count);
func_ += count;
return count;