From: Daniel Carl Date: Thu, 25 Oct 2018 21:29:43 +0000 (+0200) Subject: Fix some code indentation. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=e1e038918f328c317e688e9223150b455bd91e63;p=vimb.git Fix some code indentation. --- diff --git a/src/normal.c b/src/normal.c index 4044409..0efc0b1 100644 --- a/src/normal.c +++ b/src/normal.c @@ -751,7 +751,7 @@ static VbResult normal_view_source(Client *c, const NormalCmdInfo *info) } webkit_web_resource_get_data(resource, NULL, - (GAsyncReadyCallback)normal_view_source_loaded, c); + (GAsyncReadyCallback)normal_view_source_loaded, c); return RESULT_COMPLETE; } @@ -764,10 +764,12 @@ static void normal_view_source_loaded(WebKitWebResource *resource, char *text = NULL; data = webkit_web_resource_get_data_finish(resource, res, &length, NULL); - text = g_strndup(data, length); - command_spawn_editor(c, &((Arg){0, (char *)text}), NULL, NULL); - g_free(data); - g_free(text); + if (data) { + text = g_strndup(data, length); + command_spawn_editor(c, &((Arg){0, (char *)text}), NULL, NULL); + g_free(data); + g_free(text); + } } static VbResult normal_yank(Client *c, const NormalCmdInfo *info) diff --git a/src/util.c b/src/util.c index 0255e54..e22bb1d 100644 --- a/src/util.c +++ b/src/util.c @@ -134,8 +134,8 @@ gboolean util_create_tmp_file(const char *content, char **file) } if (content == NULL) { - close(fp); - return TRUE; + close(fp); + return TRUE; } len = strlen(content);