* configure.in (hppa*-*-*): Also configure and build stabs-only
[deliverable/binutils-gdb.git] / gdb / putenv.c
index b9de9f08460e67d38cbaab92aa733dcd18ecd887..e2ea3572d91df58ecb5c0d2e62d349258938d293 100644 (file)
@@ -30,7 +30,7 @@ domain program.
 
 extern  char  **environ;
 
-char  *index();
+char  *strchr();
 char  *malloc();
 
 /****************************************************************/
@@ -68,15 +68,17 @@ putenv( entry )
 {
   unsigned length;
   unsigned size;
+  char     *temp;
   char     **p;
   char     **new_environ;
 
   /*  Find the length of the "NAME="  */
 
-  if ( (length=(unsigned) index(entry,'=')) == 0 )
+  temp = strchr(entry,'=');
+  if ( temp == 0 )
     return( -1 );
 
-  length = length - (unsigned) entry + 1;
+  length = (unsigned) (temp - entry + 1);
 
 
   /*  Scan through the environment looking for "NAME="  */
@@ -95,10 +97,10 @@ putenv( entry )
 
   new_environ = (char **) malloc( (size+2)*PSIZE );
 
-  if ( new_environ == NULL )
+  if ( new_environ == (char **) NULL )
     return( -1 );
 
-  bcopy( (char *) environ, (char *) new_environ, size*PSIZE );
+  memcpy ((char *) new_environ, (char *) environ, size*PSIZE );
 
   new_environ[size]   = entry;
   new_environ[size+1] = NULL;
This page took 0.022929 seconds and 4 git commands to generate.