~emersion/mrsh-dev

Check return value of times against (clock_t)-1 v1 PROPOSED

Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/mrsh-dev/%3C20181228183104.9698-1-sir%40cmpwn.com%3E/mbox | git am -3
Learn more about email & git

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

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
@@ -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
To git.sr.ht:~emersion/mrsh
   4296e38..8a39bf5  master -> master

Thanks!
View this thread in the archives