1 2

[PATCH] Check return value of times against (clock_t)-1

Details
Message ID
<20181228183104.9698-1-sir@cmpwn.com>
DKIM signature
permerror
Download raw message
Patch: +1 -1
Fixes #76
---
 builtin/times.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/times.c b/builtin/times.c
index 7d1c68c..9bafab8 100644
--- a/builtin/times.c
+++ b/builtin/times.c
@@ -22,7 +22,7 @@ int builtin_times(struct mrsh_state *state, int argc, char *argv[]) {
 		return EXIT_FAILURE;
 	}
 
-	if (times(&buf) == -1) {
+	if (times(&buf) == (clock_t)-1) {
 		fprintf(stderr, "times error: %s", strerror(errno));
 		return EXIT_FAILURE;
 	}
-- 
-- 
2.20.1
Details
Message ID
<IFm_KbyqJDNz69Iiw5nYPHhJ7NOarJsIwM-HZaDrMmtnZhIfsiSmLqLzkCD58-F9ufB5_cIU8xIOuNavrFpz3o8yF19Nvxte8evdfiWndkM=@emersion.fr>
In-Reply-To
<20181228183104.9698-1-sir@cmpwn.com> (view parent)
DKIM signature
pass
Download raw message
To git.sr.ht:~emersion/mrsh
   4296e38..8a39bf5  master -> master

Thanks!