elementary value provider: replace sprintf() with snprintf()

Avoid vulerable function usage in the test code
This commit is contained in:
Hermet Park 2020-02-14 17:22:53 +09:00
parent f80189c343
commit 0a26ea3594
1 changed files with 5 additions and 5 deletions

View File

@ -280,17 +280,17 @@ void values_input(Eo* box, const char* type)
char text[2][2];
if (!strcmp(type, "TrPosition"))
{
sprintf(text[0], "X");
sprintf(text[1], "Y");
snprintf(text[0], sizeof(text[0]), "X");
snprintf(text[1], sizeof(text[1]), "Y");
}
else if (!strcmp(type, "TrScale"))
{
sprintf(text[0], "W");
sprintf(text[1], "H");
snprintf(text[0], sizeof(text[0]), "W");
snprintf(text[1], sizeof(text[1]), "H");
}
else if (!strcmp(type, "TrRotation"))
{
sprintf(text[0], "R");
snprintf(text[0], sizeof(text[0]), "R");
}
int value_cnt = strstr(type, "Rotation") ? 1 : 2;