commit 7e1f3a3d0f07de14dd5caeb7dd7b3a802afe3723 from: Omar Polo via: Thomas Adam date: Tue Aug 16 13:20:41 2022 UTC check for fprintf failure commit - b6bfeb85557195c11514ad96b30ce83da839b708 commit + 7e1f3a3d0f07de14dd5caeb7dd7b3a802afe3723 blob - a998453e7e5bc7ff3b9c707e6d83dfc42d959d5d blob + 0a212239b670c6ca16ed4334951fffdc07ca2c70 --- lib/diff.c +++ lib/diff.c @@ -904,6 +904,9 @@ show_object_id(struct got_diff_line **lines, size_t *n off_t outoff = 0; n = fprintf(outfile, "%s %c %s\n", obj_typestr, ch, id_str); + if (n < 0) + return got_error_from_errno("fprintf"); + if (lines != NULL && *lines != NULL) { if (*nlines == 0) { err = add_line_metadata(lines, nlines, 0,