- curl_easy_perform(curl);
- filesize = ftell(file);
- claws_safe_fclose(file);
- if (filesize < MIN_PNG_SIZE)
- debug_print("not enough data for an avatar image: %ld bytes\n", filesize);
- else
- image = image_pixbuf_from_filename(filename);
-
- if (!libravatarprefs.cache_icons || filesize == 0) {
- if (g_unlink(filename) < 0)
- g_warning("failed to delete cache file '%s'", filename);
- }
+ res = curl_easy_perform(curl);
+ if (res != CURLE_OK) {
+ debug_print("curl_easy_perfom failed: %s", curl_easy_strerror(res));
+ claws_safe_fclose(file);
+ } else {
+ filesize = ftell(file);
+ claws_safe_fclose(file);
+ if (filesize < MIN_PNG_SIZE)
+ debug_print("not enough data for an avatar image: %ld bytes\n", filesize);
+ else
+ image = image_pixbuf_from_filename(filename);
+
+ if (!libravatarprefs.cache_icons || filesize == 0) {
+ if (g_unlink(filename) < 0)
+ g_warning("failed to delete cache file '%s'", filename);
+ }