edje_cc handle theoretical string overflow (not real) shhh coverity

these strings are internal fixed strings so never bigger than buffer,.
but silence coverity to avoid noise. fixes CID 1355588 , 1355589
This commit is contained in:
Carsten Haitzler 2016-07-11 22:23:58 +09:00
parent 52f752f73d
commit 4329a359dc
1 changed files with 4 additions and 2 deletions

View File

@ -216,7 +216,8 @@ new_object(void)
char buf[512] = { 0, };
char *end;
strcpy(buf, id);
strncpy(buf, id, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = 0;
end = strrchr(buf, '.');
if (end) end++;
else end = buf;
@ -256,7 +257,8 @@ new_statement(void)
char buf[512] = { 0, };
char *end;
strcpy(buf, id);
strncpy(buf, id, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = 0;
end = strrchr(buf, '.');
if (end) end++;
else end = buf;