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 <argz.h>
8 #include <stddef.h>
9 #include <sys/types.h>
10 
11 size_t
argz_count(const char * argz,size_t argz_len)12 argz_count (const char *argz,
13        size_t argz_len)
14 {
15   size_t i;
16   size_t count = 0;
17 
18   for (i = 0; i < argz_len; i++)
19     {
20       if (argz[i] == '\0')
21         count++;
22     }
23   return count;
24 }
25