/* count() counts the number of strings in array ARGV.  */
static int count(char __user *__user *argv, int max)
/* count() counts the number of strings in array ARGV.  */
static int count(char __user *__user *argv, int max)
{
	int i = 0;
	if (argv != NULL) {
		for (;;) {
			char __user * p;
			if (get_user(p, argv))
				return -EFAULT;
			if (!p)
				break;
			argv++;
			if (i++ >= max)
				return -E2BIG;
			cond_resched();
		}
	}
	return i;
}