embryo_cc - fix coverity buffer complaint

this isnt an actual problem, but best it never comes around again. fix
CID 1039585
This commit is contained in:
Carsten Haitzler 2014-09-01 18:31:54 +09:00
parent 3c5412f728
commit 6d694962c6
1 changed files with 4 additions and 2 deletions

View File

@ -170,7 +170,8 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam,
{
if (oper == op1[i])
{
strcpy(opername, binoperstr[i]);
strncpy(opername, binoperstr[i], sizeof(opername) - 1);
opername[sizeof(opername) - 1] = 0;
savepri = binoper_savepri[i];
break;
} /* if */
@ -190,7 +191,8 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam,
{
if (oper == unopers[i])
{
strcpy(opername, unoperstr[i]);
strncpy(opername, unoperstr[i], sizeof(opername) - 1);
opername[sizeof(opername) - 1] = 0;
break;
} /* if */
} /* for */