From 1385899416a4396385ad421ae1f532be7103738a Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 8 Oct 2006 12:49:22 +0000 Subject: attempt to regularize atoi mess. --- procps/pidof.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'procps/pidof.c') diff --git a/procps/pidof.c b/procps/pidof.c index e6c954843..62c590fd8 100644 --- a/procps/pidof.c +++ b/procps/pidof.c @@ -14,7 +14,7 @@ #define SINGLE (1<<0) #else #define _SINGLE_COMPL(a) -#define SINGLE (0) +#define SINGLE 0 #endif #if ENABLE_FEATURE_PIDOF_OMIT @@ -56,7 +56,7 @@ int pidof_main(int argc, char **argv) /* are we asked to exclude the parent's process ID? */ if (!strncmp(omits_p->data, "%PPID", 5)) { llist_pop(&omits_p); - snprintf(getppid_str, sizeof(getppid_str), "%d", getppid()); + snprintf(getppid_str, sizeof(getppid_str), "%ld", (long)getppid()); llist_add_to(&omits_p, getppid_str); } omits_p = omits_p->link; @@ -64,19 +64,19 @@ int pidof_main(int argc, char **argv) } #endif /* Looks like everything is set to go. */ - while(optind < argc) { + while (optind < argc) { long *pidList; long *pl; /* reverse the pidlist like GNU pidof does. */ pidList = pidlist_reverse(find_pid_by_name(argv[optind])); - for(pl = pidList; *pl > 0; pl++) { + for (pl = pidList; *pl > 0; pl++) { #if ENABLE_FEATURE_PIDOF_OMIT unsigned omitted = 0; if (opt & OMIT) { llist_t *omits_p = omits; while (omits_p) - if (strtol(omits_p->data, NULL, 10) == *pl) { + if (xatoul(omits_p->data) == *pl) { omitted = 1; break; } else omits_p = omits_p->link; -- cgit v1.2.3