fix clang nonnull report

This commit is contained in:
Carsten Haitzler 2013-07-16 16:57:14 +09:00
parent aaf5a55319
commit 7f2eafc8f1
1 changed files with 12 additions and 9 deletions

View File

@ -382,15 +382,18 @@ _embryo_str_snprintf(Embryo_Program *ep, Embryo_Cell *params)
int l;
STRGET(ep, tmp, params[4 + p]);
l = strlen(tmp);
if ((o + l) > (params[2] - 1))
{
l = params[2] - 1 - o;
if (l < 0) l = 0;
tmp[l] = 0;
}
strcpy(s2 + o, tmp);
o += l;
if (tmp)
{
l = strlen(tmp);
if ((o + l) > (params[2] - 1))
{
l = params[2] - 1 - o;
if (l < 0) l = 0;
tmp[l] = 0;
}
strcpy(s2 + o, tmp);
o += l;
}
p++;
}
break;