From: Stefan Beller Date: Fri, 1 Apr 2016 00:17:29 +0000 (-0700) Subject: submodule--helper, module_clone: catch fprintf failure X-Git-Tag: v2.8.3~39^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f15ba1f3c370acbe85d451fe1520bffe0b2cb6f;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- 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);