bugfix: don't crash when saving screenshots with no file extension
authorMike Blumenkrantz <zmike@samsung.com>
Thu, 13 Mar 2014 16:33:35 +0000 (12:33 -0400)
committerMike Blumenkrantz <zmike@samsung.com>
Thu, 13 Mar 2014 16:35:43 +0000 (12:35 -0400)
CID 1132744

src/modules/shot/e_mod_main.c

index 718f748..d6a3b6a 100644 (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);