Skip to content

Commit 1f15ba1

Browse files
stefanbellergitster
authored andcommitted
submodule--helper, module_clone: catch fprintf failure
The return value of fprintf is unchecked, which may lead to unreported errors. Use fprintf_or_die to report the error to the user. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1ea4d9b commit 1f15ba1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/submodule--helper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ static int module_clone(int argc, const char **argv, const char *prefix)
229229
if (!submodule_dot_git)
230230
die_errno(_("cannot open file '%s'"), sb.buf);
231231

232-
fprintf(submodule_dot_git, "gitdir: %s\n",
233-
relative_path(sm_gitdir, path, &rel_path));
232+
fprintf_or_die(submodule_dot_git, "gitdir: %s\n",
233+
relative_path(sm_gitdir, path, &rel_path));
234234
if (fclose(submodule_dot_git))
235235
die(_("could not close file %s"), sb.buf);
236236
strbuf_reset(&sb);

0 commit comments

Comments
 (0)