Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
bca90bac
...
bca90bac24a8bb2bad44fe3f3db328af1beb0a08
authored
2001-07-09 07:50:14 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
use util_[cm]alloc() where appropriate
1 parent
5a5f7a59
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
11 deletions
mail/alias.c
mail/alt.c
mail/mail.c
mail/shell.c
mail/unset.c
mail/alias.c
View file @
bca90ba
...
...
@@ -99,7 +99,7 @@ alias_rehash()
return
1
;
}
aliases
=
calloc
(
hash_size
[
hash_num
],
sizeof
(
aliases
[
0
]));
aliases
=
util_
calloc
(
hash_size
[
hash_num
],
sizeof
(
aliases
[
0
]));
if
(
old_aliases
)
{
for
(
i
=
0
;
i
<
hash_size
[
hash_num
-
1
];
i
++
)
...
...
mail/alt.c
View file @
bca90ba
...
...
@@ -72,12 +72,7 @@ mail_set_my_name (char *name)
my_name
=
strdup
(
name
);
gethostname
(
hostname
,
sizeof
(
hostname
));
hostname
[
sizeof
(
hostname
)
-
1
]
=
0
;
my_email
=
malloc
(
strlen
(
name
)
+
strlen
(
hostname
)
+
2
);
if
(
!
my_email
)
{
util_error
(
"not enough memory"
);
abort
();
}
my_email
=
util_malloc
(
strlen
(
name
)
+
strlen
(
hostname
)
+
2
);
sprintf
(
my_email
,
"%s@%s"
,
name
,
hostname
);
}
...
...
mail/mail.c
View file @
bca90ba
...
...
@@ -73,7 +73,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
int
len
;
char
*
home
=
getenv
(
"HOME"
);
len
=
strlen
(
home
)
+
strlen
(
"/mbox"
)
+
1
;
args
->
file
=
malloc
(
len
*
sizeof
(
char
));
args
->
file
=
util_
malloc
(
len
*
sizeof
(
char
));
strcpy
(
args
->
file
,
home
);
strcat
(
args
->
file
,
"/mbox"
);
}
...
...
@@ -391,7 +391,7 @@ mail_mainloop(char *(*input) __P((void *, int)), void *closure, int do_history)
break
;
}
command
[
len
-
1
]
=
'\0'
;
buf
=
malloc
((
len
+
strlen
(
command2
))
*
sizeof
(
char
));
buf
=
util_
malloc
((
len
+
strlen
(
command2
))
*
sizeof
(
char
));
strcpy
(
buf
,
command
);
strcat
(
buf
,
command2
);
free
(
command
);
...
...
mail/shell.c
View file @
bca90ba
...
...
@@ -48,7 +48,7 @@ mail_shell (int argc, char **argv)
char
*
buf
=
NULL
;
/* 1(shell) + 1 (-c) + 1(arg) + 1 (null) = 4 */
argvec
=
malloc
(
4
*
(
sizeof
(
char
*
)));
argvec
=
util_
malloc
(
4
*
(
sizeof
(
char
*
)));
argcv_string
(
argc
-
1
,
&
argv
[
1
],
&
buf
);
...
...
mail/unset.c
View file @
bca90ba
...
...
@@ -31,7 +31,7 @@ mail_unset (int argc, char **argv)
int
status
=
0
,
i
=
1
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
char
*
buf
=
malloc
((
7
+
strlen
(
argv
[
i
]))
*
sizeof
(
char
));
char
*
buf
=
util_
malloc
((
7
+
strlen
(
argv
[
i
]))
*
sizeof
(
char
));
strcpy
(
buf
,
"set no"
);
strcat
(
buf
,
argv
[
i
]);
if
(
!
util_do_command
(
buf
))
...
...
Please
register
or
sign in
to post a comment