compiler warning
This commit is contained in:
parent
875778b25a
commit
7f037334bf
|
|
@ -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"
|
||||||
|
|
@ -129,14 +130,9 @@ LibExprParser::copyInput(char *buf,
|
||||||
{
|
{
|
||||||
size_t length = strlen(func_);
|
size_t length = strlen(func_);
|
||||||
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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue