fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / libc / argz / argz_next.c
blobe9dbe0694a35e302e1f1e261d6db96c61e38e4a6
1 /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
5 */
7 #include <errno.h>
8 #include <sys/types.h>
9 #include <string.h>
10 #include <stdlib.h>
12 char *
13 _DEFUN (argz_next, (argz, argz_len, entry),
14 char *argz _AND
15 size_t argz_len _AND
16 const char *entry)
18 if (entry)
20 while(*entry != '\0')
21 entry++;
22 entry++;
24 if (entry >= argz + argz_len)
25 return NULL;
26 else
27 return (char *) entry;
29 else
31 if (argz_len > 0)
32 return (char *) argz;
33 else
34 return NULL;