summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/lib
diff options
context:
space:
mode:
authorghelmer <ghelmer@FreeBSD.org>2000-04-30 15:57:00 +0000
committerghelmer <ghelmer@FreeBSD.org>2000-04-30 15:57:00 +0000
commitf80ecf46c4555416f247a286251db82a97a39254 (patch)
tree4aeb26dde54cb7f719a075b7e46314f35bcb6e58 /usr.sbin/cron/lib
parent4fcb0bd62318f4a51da788fe21344c23413a614c (diff)
downloadFreeBSD-src-f80ecf46c4555416f247a286251db82a97a39254.zip
FreeBSD-src-f80ecf46c4555416f247a286251db82a97a39254.tar.gz
Allocate space for arrays of type "char *", not "char **".
Rev 1.8 made the type consistently incorrect. Noted by: Ben Smithurst <ben@scientia.demon.co.uk>
Diffstat (limited to 'usr.sbin/cron/lib')
-rw-r--r--usr.sbin/cron/lib/env.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/cron/lib/env.c b/usr.sbin/cron/lib/env.c
index eb956a0..71e0398 100644
--- a/usr.sbin/cron/lib/env.c
+++ b/usr.sbin/cron/lib/env.c
@@ -27,7 +27,7 @@ static const char rcsid[] =
char **
env_init()
{
- register char **p = (char **) malloc(sizeof(char **));
+ register char **p = (char **) malloc(sizeof(char *));
if (p)
p[0] = NULL;
@@ -56,7 +56,7 @@ env_copy(envp)
for (count = 0; envp[count] != NULL; count++)
;
- p = (char **) malloc((count+1) * sizeof(char **)); /* 1 for the NULL */
+ p = (char **) malloc((count+1) * sizeof(char *)); /* 1 for the NULL */
if (p == NULL) {
errno = ENOMEM;
return NULL;
@@ -116,7 +116,7 @@ env_set(envp, envstr)
* array.
*/
p = (char **) realloc((void *) envp,
- (unsigned) ((count+1) * sizeof(char **)));
+ (unsigned) ((count+1) * sizeof(char *)));
if (p == NULL) {
/* XXX env_free(envp); */
errno = ENOMEM;
OpenPOWER on IntegriCloud