BSD 4_4_Lite1 release
[unix-history] / usr / src / lib / libc / stdlib / putenv.c
index 2109223..eb5e805 100644 (file)
@@ -32,7 +32,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)putenv.c   8.1 (Berkeley) 6/4/93";
+static char sccsid[] = "@(#)putenv.c   8.2 (Berkeley) 3/27/94";
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdlib.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdlib.h>
@@ -42,17 +42,17 @@ int
 putenv(str)
        const char *str;
 {
 putenv(str)
        const char *str;
 {
-       register char *p, *equal;
+       char *p, *equal;
        int rval;
 
        int rval;
 
-       if (!(p = strdup(str)))
-               return(1);
-       if (!(equal = index(p, '='))) {
+       if ((p = strdup(str)) == NULL)
+               return (-1);
+       if ((equal = index(p, '=')) == NULL) {
                (void)free(p);
                (void)free(p);
-               return(1);
+               return (-1);
        }
        *equal = '\0';
        rval = setenv(p, equal + 1, 1);
        (void)free(p);
        }
        *equal = '\0';
        rval = setenv(p, equal + 1, 1);
        (void)free(p);
-       return(rval);
+       return (rval);
 }
 }