Commit fd7927cd by Eric Botcazou Committed by Eric Botcazou

env.c (__gnat_setenv): Use size_t.

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

From-SVN: r111155
parent e1e835dc
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> 2006-02-16 Arnaud Charlet <charlet@adacore.com>
* opt.ads (Ada_Version_Default): Set to Ada 2005 by default. * opt.ads (Ada_Version_Default): Set to Ada 2005 by default.
......
...@@ -170,7 +170,7 @@ __gnat_setenv (char *name, char *value) ...@@ -170,7 +170,7 @@ __gnat_setenv (char *name, char *value)
setenv (name, value, 1); setenv (name, value, 1);
#else #else
int size = strlen (name) + strlen (value) + 2; size_t size = strlen (name) + strlen (value) + 2;
char *expression; char *expression;
expression = (char *) xmalloc (size * sizeof (char)); expression = (char *) xmalloc (size * sizeof (char));
...@@ -234,7 +234,7 @@ void __gnat_unsetenv (char *name) { ...@@ -234,7 +234,7 @@ void __gnat_unsetenv (char *name) {
As we are still supporting AIX 5.1 we cannot use unsetenv */ As we are still supporting AIX 5.1 we cannot use unsetenv */
char **env = __gnat_environ (); char **env = __gnat_environ ();
int index = 0; int index = 0;
int size = strlen (name); size_t size = strlen (name);
while (env[index] != NULL) { while (env[index] != NULL) {
if (strlen (env[index]) > size) { if (strlen (env[index]) > size) {
...@@ -258,7 +258,7 @@ void __gnat_unsetenv (char *name) { ...@@ -258,7 +258,7 @@ void __gnat_unsetenv (char *name) {
/* On Windows platform putenv ("key=") is equivalent to unsetenv (a /* On Windows platform putenv ("key=") is equivalent to unsetenv (a
subsequent call to getenv ("key") will return NULL and not the "\0" subsequent call to getenv ("key") will return NULL and not the "\0"
string */ string */
int size = strlen (name) + 2; size_t size = strlen (name) + 2;
char *expression; char *expression;
expression = (char *) xmalloc (size * sizeof (char)); expression = (char *) xmalloc (size * sizeof (char));
...@@ -293,7 +293,7 @@ void __gnat_clearenv (void) { ...@@ -293,7 +293,7 @@ void __gnat_clearenv (void) {
environment but there is a "clean" way to unset a variable. So go environment but there is a "clean" way to unset a variable. So go
through the environ table and call __gnat_unsetenv on all entries */ through the environ table and call __gnat_unsetenv on all entries */
char **env = __gnat_environ (); char **env = __gnat_environ ();
int size; size_t size;
while (env[0] != NULL) { while (env[0] != NULL) {
size = 0; size = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment