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 "FuncExpr.hh"
#include <algorithm> // min
#include "Report.hh" #include "Report.hh"
#include "StringUtil.hh" #include "StringUtil.hh"
#include "Liberty.hh" #include "Liberty.hh"
@ -131,12 +132,7 @@ LibExprParser::copyInput(char *buf,
if (length == 0) if (length == 0)
return 0; return 0;
else { else {
size_t count; size_t count = std::min(length, max_size);
if (length < max_size)
count = length;
else
count = max_size;
strncpy(buf, func_, count); strncpy(buf, func_, count);
func_ += count; func_ += count;
return count; return count;