Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-05-23 20:36:23 +0400
committerCorinna Vinschen <corinna@vinschen.de>2007-05-23 20:36:23 +0400
commitd48670ed78bf8385f328b0c8bb4785b9cc169616 (patch)
treebf784758b5b8801cf4e079d61522a973bfedea05 /newlib
parentf8d72310066c1a0544d3ce213255946020797a9b (diff)
* 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++.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog7
-rw-r--r--newlib/libc/argz/argz_create_sep.c1
-rw-r--r--newlib/libc/include/argz.h11
3 files changed, 19 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 262ef89c7..0566b8a30 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -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
diff --git a/newlib/libc/argz/argz_create_sep.c b/newlib/libc/argz/argz_create_sep.c
index bf0670bda..bf02b492a 100644
--- a/newlib/libc/argz/argz_create_sep.c
+++ b/newlib/libc/argz/argz_create_sep.c
@@ -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);
diff --git a/newlib/libc/include/argz.h b/newlib/libc/include/argz.h
index 76afc062d..02c9adbf3 100644
--- a/newlib/libc/include/argz.h
+++ b/newlib/libc/include/argz.h
@@ -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_ */