Apply patch from Felipe Kellermann to simlify logic of sort functions.
[oweals/busybox.git] / procps / pidof.c
index 169a92007ea3f867ad4aa8a1de0e1de334a89db5..413864a37f26e9de3f1a012c6e71b19e89bb2353 100644 (file)
@@ -2,8 +2,7 @@
 /*
  * pidof implementation for busybox
  *
- * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
- * Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -46,17 +45,18 @@ extern int pidof_main(int argc, char **argv)
                                single_flag = 1;
                                break;
                        default:
-                               show_usage();
+                               bb_show_usage();
                }
        }
 
        /* Looks like everything is set to go. */
        while(optind < argc) {
-               long* pidList;
+               long *pidList;
+               long *pl;
 
                pidList = find_pid_by_name(argv[optind]);
-               for(; *pidList > 0; pidList++) {
-                       printf("%s%ld", (n++ ? " " : ""), (long)*pidList);
+               for(pl = pidList; *pl > 0; pl++) {
+                       printf("%s%ld", (n++ ? " " : ""), *pl);
                        fail = 0;
                        if (single_flag)
                                break;