bugfix: don't crash when saving screenshots with no file extension

CID 1132744
This commit is contained in:
Mike Blumenkrantz 2014-03-13 12:33:35 -04:00
parent b9eaf4d239
commit cea010dce0
1 changed files with 1 additions and 2 deletions

View File

@ -162,10 +162,9 @@ _screen_change_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *even
static void
_save_to(const char *file)
{
char *extn = strrchr(file, '.');
char opts[256];
if (!strcasecmp(extn, ".png"))
if (eina_str_has_extension(file, ".png"))
snprintf(opts, sizeof(opts), "compress=%i", 9);
else
snprintf(opts, sizeof(opts), "quality=%i", quality);