env.c (__gnat_setenv): Use size_t.

* env.c (__gnat_setenv): Use size_t.
	(__gnat_unsetenv): Likewise.
	(__gnat_clearenv): Likewise.

From-SVN: r111155
This commit is contained in:
Eric Botcazou 2006-02-16 22:06:06 +00:00 committed by Eric Botcazou
parent e1e835dcbb
commit fd7927cdc6
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2006-02-16 Eric Botcazou <ebotcazou@adacore.com>
* env.c (__gnat_setenv): Use size_t.
(__gnat_unsetenv): Likewise.
(__gnat_clearenv): Likewise.
2006-02-16 Arnaud Charlet <charlet@adacore.com>
* opt.ads (Ada_Version_Default): Set to Ada 2005 by default.

View file

@ -170,7 +170,7 @@ __gnat_setenv (char *name, char *value)
setenv (name, value, 1);
#else
int size = strlen (name) + strlen (value) + 2;
size_t size = strlen (name) + strlen (value) + 2;
char *expression;
expression = (char *) xmalloc (size * sizeof (char));
@ -234,7 +234,7 @@ void __gnat_unsetenv (char *name) {
As we are still supporting AIX 5.1 we cannot use unsetenv */
char **env = __gnat_environ ();
int index = 0;
int size = strlen (name);
size_t size = strlen (name);
while (env[index] != NULL) {
if (strlen (env[index]) > size) {
@ -258,7 +258,7 @@ void __gnat_unsetenv (char *name) {
/* On Windows platform putenv ("key=") is equivalent to unsetenv (a
subsequent call to getenv ("key") will return NULL and not the "\0"
string */
int size = strlen (name) + 2;
size_t size = strlen (name) + 2;
char *expression;
expression = (char *) xmalloc (size * sizeof (char));
@ -293,7 +293,7 @@ void __gnat_clearenv (void) {
environment but there is a "clean" way to unset a variable. So go
through the environ table and call __gnat_unsetenv on all entries */
char **env = __gnat_environ ();
int size;
size_t size;
while (env[0] != NULL) {
size = 0;