clone: use xfopen() instead of fopen()
copy_alternates() called fopen() without handling errors. By switching to xfopen(), this bug is fixed. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
May 3, 2017 at 17:16 UTC
02912f477586befaf46e0db4f7c47b52081d5b6d
1 file changed
+1
-1
builtin/clone.c
+1
-1
@@ -357,7 +357,7 @@ static void copy_alternates(struct strbuf *src, struct strbuf *dst,
357
* to turn entries with paths relative to the original
358
* absolute, so that they can be used in the new repository.
359
*/
360
- FILE *in = fopen(src->buf, "r");
360
+ FILE *in = xfopen(src->buf, "r");
361
struct strbuf line = STRBUF_INIT;
362
363
while (strbuf_getline(&line, in) != EOF) {