summaryrefslogtreecommitdiff
path: root/src/bin/eolian/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/eolian/main.c')
-rw-r--r--src/bin/eolian/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bin/eolian/main.c b/src/bin/eolian/main.c
index f545960ae1..55c9399937 100644
--- a/src/bin/eolian/main.c
+++ b/src/bin/eolian/main.c
@@ -105,20 +105,22 @@ _write_file(const char *filename, const Eina_Strbuf *buffer, Eina_Bool append)
105 return EINA_FALSE; 105 return EINA_FALSE;
106 } 106 }
107 107
108 Eina_Bool ret = EINA_TRUE;
108 size_t blen = eina_strbuf_length_get(buffer); 109 size_t blen = eina_strbuf_length_get(buffer);
110
109 if (!blen) 111 if (!blen)
110 return EINA_TRUE; 112 goto end;
111 113
112 if (fwrite(eina_strbuf_string_get(buffer), 1, blen, fd) != blen) 114 if (fwrite(eina_strbuf_string_get(buffer), 1, blen, fd) != blen)
113 { 115 {
114 fprintf(stderr, "eolian: could not write '%s' (%s)\n", 116 fprintf(stderr, "eolian: could not write '%s' (%s)\n",
115 filename, strerror(errno)); 117 filename, strerror(errno));
116 fclose(fd); 118 ret = EINA_FALSE;
117 return EINA_FALSE;
118 } 119 }
119 120
121end:
120 fclose(fd); 122 fclose(fd);
121 return EINA_TRUE; 123 return ret;
122} 124}
123 125
124static Eina_Bool 126static Eina_Bool