summaryrefslogtreecommitdiff
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-04-01 00:17:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-04-01 21:04:33 (GMT)
commit1f15ba1f3c370acbe85d451fe1520bffe0b2cb6f (patch)
treef1b85738a74da052ba643b4e6591ca41d4c3b217 /builtin/submodule--helper.c
parent1ea4d9b7c8008f5172e9995d87e2cf2d594a7ac7 (diff)
downloadgit-1f15ba1f3c370acbe85d451fe1520bffe0b2cb6f.zip
git-1f15ba1f3c370acbe85d451fe1520bffe0b2cb6f.tar.gz
git-1f15ba1f3c370acbe85d451fe1520bffe0b2cb6f.tar.bz2
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 <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 b59c66f..b3a60f5 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);