diff options
author | Angelo Marletta <angelo.marletta@gmail.com> | 2012-07-05 21:35:33 +0100 |
---|---|---|
committer | Angelo Marletta <angelo.marletta@gmail.com> | 2012-07-05 21:35:33 +0100 |
commit | 87694f555bca71882c7130da9e447dcdba8b697e (patch) | |
tree | 7321fee36dd2b5e948ac6f452cf1f9c57d19cb7f | |
parent | 5d616e32150643ccbf5d433ae046e532f5324de0 (diff) | |
download | cpulimit-87694f555bca71882c7130da9e447dcdba8b697e.tar.gz |
fixed compilation issue on OS X
-rw-r--r-- | src/process_iterator_apple.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/process_iterator_apple.c b/src/process_iterator_apple.c index b6cd468..b878ed8 100644 --- a/src/process_iterator_apple.c +++ b/src/process_iterator_apple.c @@ -17,6 +17,9 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Author: Simon Sigurdhsson + * */ #include <errno.h> @@ -32,10 +35,11 @@ int unique_nonzero_ints(int* arr_in, int len_in, int* arr_out) { memset(arr_out, -1, sizeof(int)*len_in); } int len_out = 0; - for (int i=0; i<len_in; i++) { + int i, j; + for (i=0; i<len_in; i++) { int found = 0; if (source[i] == 0) continue; - for (int j=0; !found && j<len_out; j++) { + for (j=0; !found && j<len_out; j++) { found = (source[i] == arr_out[j]) ? 1 : 0; } if (!found) { |