template: fix generate for names of templates.

Summary: without escaped char '\0' in the end of name, possible generate string with trash at the end. @fix

Reviewers: Hermet

Subscribers: NikaWhite

Projects: #enventor

Differential Revision: https://phab.enlightenment.org/D1303
This commit is contained in:
Mykyta Biliavskyi 2014-08-11 16:33:17 +09:00 committed by ChunEon Park
parent f6fe9b7955
commit 848c337493
1 changed files with 2 additions and 1 deletions

View File

@ -14,11 +14,12 @@ static const char *
template_part_first_line_get(void)
{
static char buf[40];
char name[8];
char name[9];
int i;
for (i = 0; i < 8; i++)
name[i] = NAME_SEED[(rand() % NAME_SEED_LEN)];
name[i]='\0';
snprintf(buf, sizeof(buf), "part { name: \"%s\";<br/>", name);