зеркало из https://github.com/microsoft/git.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 <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
1ea4d9b7c8
Коммит
1f15ba1f3c
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче