For better security, VD recommends using snprintf in place of sprintf.
Reference: https://review.tizen.org/gerrit/c/283371/
Change-Id: If615daf8f65d95f203ed856d8df4a1c87c9a8a7b
Signed-off-by: Ayush Kumar <ayush.k123@samsung.com>
if (msg_fmt == NULL) {
return NULL;
}
- sprintf(msg_fmt, fmt_hdr, fmt);
+ snprintf(msg_fmt, fmt_len, fmt_hdr, fmt);
if (add_newline) {
msg_fmt[fmt_len - 2] = '\n';
log_trace("%s", __PRETTY_FUNCTION__);
static int c = 1;
char buf[250];
- sprintf(buf, "screenshot%d.png", c++);
+ snprintf(buf, sizeof(buf), "screenshot%d.png", c++);
if (evas_object_image_save(image, buf, 0, 0))
log_info("Screenshot image saved in %s", buf);
else