commit: 64db870a04ed8533f80b25d7db09acfc4ad36643 parent bc8d1c2d2888e0c6d4b9b3e585ae04011e2dd5a5 Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me> Date: Fri, 11 Feb 2022 20:47:36 +0100 bin/date: Handle error from puts(3)Diffstat:
M | bin/date.c | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bin/date.c b/bin/date.c @@ -70,7 +70,11 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - puts(outstr); + if(puts(outstr) < 0) + { + perror("puts"); + exit(EXIT_FAILURE); + } return 0; }