summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheron <tspiegl@gmail.com>2021-05-05 22:12:01 -0500
committerTheron <tspiegl@gmail.com>2021-05-05 22:12:01 -0500
commit4cd5eeaf7dd938affab3457b46a786a82d13d099 (patch)
tree1f471c7f22724df702eaf4f86ddd864ca425b931
parente41661906310184be9f49de4292091b91fa49835 (diff)
posix regex syntaxandroid
-rw-r--r--src/attach.c3
-rw-r--r--src/whatfiles.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/attach.c b/src/attach.c
index 5c9c647..1846288 100644
--- a/src/attach.c
+++ b/src/attach.c
@@ -36,13 +36,12 @@ char read_status(pid_t pid)
FILE *h_status = fopen(path, "rb");
if (!h_status) return 0;
read_file(str, 4096, h_status);
- DEBUG("PROC FILE\n%s", str->data);
int err;
regmatch_t pmatch[2];
err = regexec(&regex, str->data, 2, pmatch, 0);
if (err) {
- DEBUG("failed to find regex match in /proc/%d/status file: 0x%x\n", pid, err);
+ DEBUG("failed to find regex match in /proc/%d/status file\n", pid);
} else {
c = *(str->data + pmatch[1].rm_so);
}
diff --git a/src/whatfiles.c b/src/whatfiles.c
index 0004308..ac87ed7 100644
--- a/src/whatfiles.c
+++ b/src/whatfiles.c
@@ -94,7 +94,7 @@ int main(int argc, char* argv[])
HashMap hashmap = &hm;
init_hashmap(hashmap);
- if (regcomp(&regex, "State:\\W+([A-Za-z])", REG_EXTENDED) != 0) {
+ if (regcomp(&regex, "State:[[:space:]]*([A-Za-z])", REG_EXTENDED) != 0) {
SYS_ERR("regex compilation error");
}