summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 343e024)
raw | patch | inline | side by side (parent: 343e024)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 15 Mar 2010 21:37:56 +0000 (22:37 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 15 Mar 2010 21:37:56 +0000 (22:37 +0100) |
Since I was picky when accepting Clément's patch, I felt like I owed it
to clean up the entire file ;)
to clean up the entire file ;)
src/processes.c | patch | blob | history |
diff --git a/src/processes.c b/src/processes.c
index 15cb0aae84c636977fff57d53e679071527b07f6..c642e58a88b1b8def6a13b8d0dbea887060e5a55 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
# define ARG_MAX 4096
#endif
-#define BUFSIZE 256
-
static const char *config_keys[] =
{
"Process",
if ((fh = fopen (filename, "r")) == NULL)
return (NULL);
- while (fgets (buffer, 1024, fh) != NULL)
+ while (fgets (buffer, sizeof (buffer), fh) != NULL)
{
derive_t *val = NULL;
long long tmp;
else
continue;
- numfields = strsplit (buffer, fields, 8);
+ numfields = strsplit (buffer, fields,
+ STATIC_ARRAY_SIZE (fields));
if (numfields < 2)
continue;
return (-1);
buffer[i] = 0;
- fields_len = strsplit (buffer, fields, 64);
+ fields_len = strsplit (buffer, fields, STATIC_ARRAY_SIZE (fields));
if (fields_len < 24)
{
DEBUG ("processes plugin: ps_read_process (pid = %i):"
errno = 0;
endptr = NULL;
- result = strtoul(fields[1], &endptr, 10);
+ result = strtoul(fields[1], &endptr, /* base = */ 10);
if ((endptr == fields[1]) || (errno != 0)) {
ERROR ("processes plugin: Cannot parse fork rate: %s",
fields[1]);