diff options
author | Darren Tucker <dtucker@zip.com.au> | 2006-05-04 16:24:34 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2006-05-04 16:24:34 +1000 |
commit | d8093e49bf06813a8c97cbc90810f4863388af77 (patch) | |
tree | 186c431180b5e63c14733c5d92a5cdb988426fca /openbsd-compat/bsd-cygwin_util.c | |
parent | 596d33801f6d703c1e45c74df6f6d6fe7ee085bb (diff) |
- (dtucker) [auth-pam.c groupaccess.c monitor.c monitor_wrap.c scard-opensc.c
session.c ssh-rand-helper.c sshd.c openbsd-compat/bsd-cygwin_util.c
openbsd-compat/setproctitle.c] Convert malloc(foo*bar) -> calloc(foo,bar)
in Portable-only code; since calloc zeros, remove now-redundant memsets.
Also add a couple of sanity checks. With & ok djm@
Diffstat (limited to 'openbsd-compat/bsd-cygwin_util.c')
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index 8f3acee26..b408dde2d 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c | |||
@@ -268,7 +268,7 @@ fetch_windows_environment(void) | |||
268 | char **e, **p; | 268 | char **e, **p; |
269 | unsigned int i, idx = 0; | 269 | unsigned int i, idx = 0; |
270 | 270 | ||
271 | p = xmalloc((WENV_SIZ + 1) * sizeof(char *)); | 271 | p = xcalloc(WENV_SIZ + 1, sizeof(char *)); |
272 | for (e = environ; *e != NULL; ++e) { | 272 | for (e = environ; *e != NULL; ++e) { |
273 | for (i = 0; i < WENV_SIZ; ++i) { | 273 | for (i = 0; i < WENV_SIZ; ++i) { |
274 | if (!strncmp(*e, wenv_arr[i].name, wenv_arr[i].namelen)) | 274 | if (!strncmp(*e, wenv_arr[i].name, wenv_arr[i].namelen)) |