mirror of
https://git.zx2c4.com/cgit
synced 2024-11-25 01:48:41 +00:00
html.c: die when write fails
If we fail to write HTML output once, there's no point carrying on so just write a failure message once and die. By using Git's die_errno function we also let the user know in what way the write failed. Signed-off-by: John Keeping <john@keeping.me.uk>
This commit is contained in:
parent
927060c5d8
commit
1fec7cd6f8
2
html.c
2
html.c
@ -78,7 +78,7 @@ char *fmtalloc(const char *format, ...)
|
|||||||
void html_raw(const char *data, size_t size)
|
void html_raw(const char *data, size_t size)
|
||||||
{
|
{
|
||||||
if (write(htmlfd, data, size) != size)
|
if (write(htmlfd, data, size) != size)
|
||||||
fprintf(stderr, "[html.c] html output truncated.\n");
|
die_errno("write error on html output");
|
||||||
}
|
}
|
||||||
|
|
||||||
void html(const char *txt)
|
void html(const char *txt)
|
||||||
|
Loading…
Reference in New Issue
Block a user