From 046a7c08c3c1e059be55ebdf49af66f5aee4800b Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 12 Mar 2017 13:27:50 +0000 Subject: Fix argument order in memchr() ! --- src/supervision/s6-supervise.c | 2 +- src/supervision/s6-svc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/supervision') diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c index dcafc83..ce74cb4 100644 --- a/src/supervision/s6-supervise.c +++ b/src/supervision/s6-supervise.c @@ -495,7 +495,7 @@ static inline void handle_notifyfd (void) while (r > 0) { r = sanitize_read(fd_read(notifyfd, buf, 4096)) ; - if (r > 0 && memchr(buf, r, '\n')) + if (r > 0 && memchr(buf, '\n', r)) { tain_copynow(&status.readystamp) ; status.flagready = 1 ; diff --git a/src/supervision/s6-svc.c b/src/supervision/s6-svc.c index ed323af..df744e3 100644 --- a/src/supervision/s6-svc.c +++ b/src/supervision/s6-svc.c @@ -56,7 +56,7 @@ int main (int argc, char const *const *argv, char const *const *envp) case 'T' : if (!uint0_scan(l.arg, &timeout)) dieusage() ; break ; case 'w' : { - if (!memchr("dDuUrR", 6, l.arg[0])) dieusage() ; + if (!memchr("dDuUrR", l.arg[0], 6)) dieusage() ; updown[1] = l.arg[0] ; break ; } -- cgit v1.2.3