Skip to content

Commit 02912f4

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 23a9e07 commit 02912f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/clone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ static void copy_alternates(struct strbuf *src, struct strbuf *dst,
357357
* to turn entries with paths relative to the original
358358
* absolute, so that they can be used in the new repository.
359359
*/
360-
FILE *in = fopen(src->buf, "r");
360+
FILE *in = xfopen(src->buf, "r");
361361
struct strbuf line = STRBUF_INIT;
362362

363363
while (strbuf_getline(&line, in) != EOF) {

0 commit comments

Comments
 (0)