summaryrefslogtreecommitdiff
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-03-31 17:17:29 -0700
committerJunio C Hamano <gitster@pobox.com>2016-04-01 14:04:33 -0700
commit1f15ba1f3c370acbe85d451fe1520bffe0b2cb6f (patch)
treef1b85738a74da052ba643b4e6591ca41d4c3b217 /builtin/submodule--helper.c
parent1ea4d9b7c8008f5172e9995d87e2cf2d594a7ac7 (diff)
downloadgit-1f15ba1f3c370acbe85d451fe1520bffe0b2cb6f.tar.gz
submodule--helper, module_clone: catch fprintf failuresb/submodule-helper-clone-regression-fix
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 <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r--builtin/submodule--helper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index b59c66f011..b3a60f56c3 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -229,8 +229,8 @@ static int module_clone(int argc, const char **argv, const char *prefix)
if (!submodule_dot_git)
die_errno(_("cannot open file '%s'"), sb.buf);
- fprintf(submodule_dot_git, "gitdir: %s\n",
- relative_path(sm_gitdir, path, &rel_path));
+ fprintf_or_die(submodule_dot_git, "gitdir: %s\n",
+ relative_path(sm_gitdir, path, &rel_path));
if (fclose(submodule_dot_git))
die(_("could not close file %s"), sb.buf);
strbuf_reset(&sb);