diff options
author | Daniel Carl <danielcarl@gmx.de> | 2018-10-25 23:29:43 +0200 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2018-10-25 23:29:43 +0200 |
commit | e1e038918f328c317e688e9223150b455bd91e63 (patch) | |
tree | 353ad731c93e8a7705832ac3d166e1787a6789b3 | |
parent | 35badf74983a39ac5e31fa2dd63ad3a02312e548 (diff) |
Fix some code indentation.
-rw-r--r-- | src/normal.c | 12 | ||||
-rw-r--r-- | src/util.c | 4 |
2 files changed, 9 insertions, 7 deletions
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) @@ -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); |