1 /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. 2 * 3 * Permission to use, copy, modify, and distribute this software 4 * is freely granted, provided that this notice is preserved. 5 */ 6 7 #include <_ansi.h> 8 #include <argz.h> 9 #include <stddef.h> 10 #include <sys/types.h> 11 12 size_t argz_count(const char * argz,size_t argz_len)13argz_count (const char *argz, 14 size_t argz_len) 15 { 16 size_t i; 17 size_t count = 0; 18 19 for (i = 0; i < argz_len; i++) 20 { 21 if (argz[i] == '\0') 22 count++; 23 } 24 return count; 25 } 26