Commit 55c36f4353bddfcfc60e717241294811b1d76bde Parent: 7c26d5a21795acd7c8a6d573aa043e8a818712a0 Author: mcol <mcol@posteo.net> Date: 2021-01-20 21:41:25 +0000 Committer: mcol <mcol@posteo.net> Committed: 2021-01-20 21:41:25 +0000 Remove redundant goto
src/config.c Modified
@@ -163,10 +163,10 @@ ) { cairo_surface_t *image = cairo_image_surface_create_from_png(path); - if (!image) - goto fail; - if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) - goto fail; + if (!image || cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) { + wlr_log(WLR_INFO, "Could not load image: %s", path); + return; + } struct wallpaper *wallpaper = calloc(1, sizeof(struct wallpaper)); wallpaper->width = cairo_image_surface_get_width(image); @@ -189,10 +189,6 @@ cairo_destroy(cr); cairo_surface_destroy(image); cairo_surface_destroy(canvas); - return; - -fail: - wlr_log(WLR_INFO, "Could not load image: %s", path); }