diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-01-05 23:47:20 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-01-06 16:43:18 +0100 |
commit | e103ec0317a88965b74107a1f2d780573c464ac8 (patch) | |
tree | 24a244f07569849948a24038a1fbfd4726598b4e /linux/LinuxProcess.c | |
parent | 7ff654f2df3a49c6b46e19b95533da531f71be5b (diff) |
Declare for loop variables inside the loop
Diffstat (limited to 'linux/LinuxProcess.c')
-rw-r--r-- | linux/LinuxProcess.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index a45505e2..10017bd1 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -198,12 +198,11 @@ static bool findCommInCmdline(const char *comm, const char *cmdline, int cmdline /* Try to find procComm in tokenized cmdline - this might in rare cases * mis-identify a string or fail, if comm or cmdline had been unsuitably * modified by the process */ - const char *token; const char *tokenBase; size_t tokenLen; const size_t commLen = strlen(comm); - for (token = cmdline + cmdlineBasenameOffset; *token; ) { + for (const char *token = cmdline + cmdlineBasenameOffset; *token; ) { for (tokenBase = token; *token && *token != '\n'; ++token) { if (*token == '/') { tokenBase = token + 1; |