From 06ff929020754f26c4b043ff63be50a16bd25582 Mon Sep 17 00:00:00 2001 From: semarie Date: Sun, 18 Oct 2015 12:25:33 +0000 Subject: [PATCH] regress pledge: tweak a bit the manner to grab hte syscall number permit debug string be present on the line --- regress/sys/kern/pledge/generic/manager.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/regress/sys/kern/pledge/generic/manager.c b/regress/sys/kern/pledge/generic/manager.c index 1f5ead155e4..4f8121cd1fa 100644 --- a/regress/sys/kern/pledge/generic/manager.c +++ b/regress/sys/kern/pledge/generic/manager.c @@ -1,4 +1,4 @@ -/* $OpenBSD: manager.c,v 1.2 2015/10/09 11:38:05 semarie Exp $ */ +/* $OpenBSD: manager.c,v 1.3 2015/10/18 12:25:33 semarie Exp $ */ /* * Copyright (c) 2015 Sebastien Marie * @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -125,7 +126,14 @@ grab_syscall(pid_t pid) /* check if found */ if (strncmp(search, line, searchlen) == 0) { const char *errstr = NULL; - /* found */ + char *c; + /* truncate at first no-number */ + for (c = line + searchlen; (*c != '\0') && isdigit(*c); + c++) + ; + *c = '\0'; + + /* convert it */ ret = strtonum(line + searchlen, 0, 255, &errstr); if (errstr) { warn("strtonum: line=%s err=%s", line, errstr); -- 2.20.1