* libc/argz/argz_create_sep.c (argz_create_sep): Initialize *argz_len

to zero.
	* libc/include/argz.h: Guard against multiple inclusion.  Guard for
	use with C++.
This commit is contained in:
Corinna Vinschen 2007-05-23 16:36:23 +00:00
parent f8d7231006
commit d48670ed78
3 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2007-05-23 Corinna Vinschen <vinschen@redhat.com>
* libc/argz/argz_create_sep.c (argz_create_sep): Initialize *argz_len
to zero.
* libc/include/argz.h: Guard against multiple inclusion. Guard for
use with C++.
2007-05-18 Eric Blake <ebb9@byu.net>
* libc/stdio/vfprintf.c [_WANT_IO_LONG_LONG]: Allow non-gcc

View File

@ -31,6 +31,7 @@ _DEFUN (argz_create_sep, (string, sep, argz, argz_len),
running = strdup(string);
old_running = running;
*argz_len = 0;
while ((token = strsep(&running, delim)))
{
len = strlen(token);

View File

@ -4,9 +4,16 @@
* is freely granted, provided that this notice is preserved.
*/
#ifndef _ARGZ_H_
#define _ARGZ_H_
#include <errno.h>
#include <sys/types.h>
#include "_ansi.h"
_BEGIN_STD_C
/* The newlib implementation of these functions assumes that sizeof(char) == 1. */
error_t argz_create (char *const argv[], char **argz, size_t *argz_len);
error_t argz_create_sep (const char *string, int sep, char **argz, size_t *argz_len);
@ -20,3 +27,7 @@ error_t argz_delete (char **argz, size_t *argz_len, char *entry);
error_t argz_insert (char **argz, size_t *argz_len, char *before, const char *entry);
char * argz_next (char *argz, size_t argz_len, const char *entry);
error_t argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, unsigned *replace_count);
_END_STD_C
#endif /* _ARGZ_H_ */