summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/setenv.c
diff options
context:
space:
mode:
authorderaadt <>2001-07-09 06:57:45 +0000
committerderaadt <>2001-07-09 06:57:45 +0000
commit5ca33118ee381fe2484a9244aab71efe5cfdd924 (patch)
treefa9c5396add3b577dbec4565f937530d424d77e6 /src/lib/libc/stdlib/setenv.c
parent4f70c6d1f894b725caae01ff86cc2448630c66f1 (diff)
downloadopenbsd-5ca33118ee381fe2484a9244aab71efe5cfdd924.tar.gz
openbsd-5ca33118ee381fe2484a9244aab71efe5cfdd924.tar.bz2
openbsd-5ca33118ee381fe2484a9244aab71efe5cfdd924.zip
a first pass at -Wall
Diffstat (limited to 'src/lib/libc/stdlib/setenv.c')
-rw-r--r--src/lib/libc/stdlib/setenv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libc/stdlib/setenv.c b/src/lib/libc/stdlib/setenv.c
index b6f261e61c..fc7c67a5db 100644
--- a/src/lib/libc/stdlib/setenv.c
+++ b/src/lib/libc/stdlib/setenv.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char *rcsid = "$OpenBSD: setenv.c,v 1.3 1998/02/02 22:44:53 millert Exp $"; 35static char *rcsid = "$OpenBSD: setenv.c,v 1.4 2001/07/09 06:57:45 deraadt Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <stdlib.h> 38#include <stdlib.h>
@@ -62,7 +62,8 @@ setenv(name, value, rewrite)
62 if (!rewrite) 62 if (!rewrite)
63 return (0); 63 return (0);
64 if (strlen(C) >= l_value) { /* old larger; copy over */ 64 if (strlen(C) >= l_value) { /* old larger; copy over */
65 while (*C++ = *value++); 65 while ((*C++ = *value++))
66 ;
66 return (0); 67 return (0);
67 } 68 }
68 } else { /* create new slot */ 69 } else { /* create new slot */
@@ -95,7 +96,7 @@ setenv(name, value, rewrite)
95 return (-1); 96 return (-1);
96 for (C = environ[offset]; (*C = *name++) && *C != '='; ++C) 97 for (C = environ[offset]; (*C = *name++) && *C != '='; ++C)
97 ; 98 ;
98 for (*C++ = '='; *C++ = *value++; ) 99 for (*C++ = '='; (*C++ = *value++); )
99 ; 100 ;
100 return (0); 101 return (0);
101} 102}