summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libcommon/proc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libcommon/proc.c b/src/libcommon/proc.c
index 16c439f..12ea071 100644
--- a/src/libcommon/proc.c
+++ b/src/libcommon/proc.c
@@ -79,7 +79,6 @@ int syscommon_proc_get_attr_current(pid_t pid, char *buf, int len)
int syscommon_proc_is_app(pid_t pid)
{
char attr[NAME_MAX] = { 0 ,};
- size_t len = 0;
int ret = 0;
ret = syscommon_proc_get_attr_current(pid, attr, sizeof(attr));
@@ -88,15 +87,13 @@ int syscommon_proc_is_app(pid_t pid)
return -1;
}
- len = strlen(attr) + 1;
-
- if (!strncmp("System", attr, len))
+ if (!strncmp("System", attr, sizeof("System")))
return 0;
- if (!strncmp("User", attr, len))
+ if (!strncmp("User", attr, sizeof("User")))
return 0;
- if (!strncmp("System::Privileged", attr, len))
+ if (!strncmp("System::Privileged", attr, sizeof("System::Privileged")))
return 0;
return 1;