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
c3c88289
...
c3c88289add5855a11689d9ecadf267e2cc7d62f
authored
2001-07-27 09:36:03 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Removed util_[mc]alloc() in favor of x[mc]alloc().
1 parent
15a17e9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
29 deletions
mail/util.c
mail/util.c
View file @
c3c8828
...
...
@@ -41,7 +41,7 @@ static node *env_cursor = NULL;
static
node
*
util_ll_add
(
node
*
c
,
int
data
)
{
c
->
next
=
util_
malloc
(
sizeof
(
node
));
c
->
next
=
x
malloc
(
sizeof
(
node
));
c
->
data
=
data
;
c
->
next
->
env_entry
.
var
=
NULL
;
c
->
next
->
env_entry
.
set
=
0
;
...
...
@@ -80,7 +80,7 @@ util_expand_msglist (const int argc, char **argv, int **list)
int
undelete
=
0
;
int
*
ret
=
NULL
;
/* let's try a linked list */
node
*
first
=
util_
malloc
(
sizeof
(
node
));
node
*
first
=
x
malloc
(
sizeof
(
node
));
node
*
current
=
first
;
first
->
next
=
NULL
;
...
...
@@ -150,7 +150,7 @@ util_expand_msglist (const int argc, char **argv, int **list)
{
/* all messages */
util_ll_free
(
first
);
current
=
first
=
util_
malloc
(
sizeof
(
node
));
current
=
first
=
x
malloc
(
sizeof
(
node
));
for
(
i
=
1
;
i
<=
total
;
i
++
)
current
=
util_ll_add
(
current
,
i
);
i
=
argc
+
1
;
...
...
@@ -255,13 +255,13 @@ util_expand_msglist (const int argc, char **argv, int **list)
if
(
!
lc
)
{
ret
=
util_
calloc
(
1
,
sizeof
(
int
));
ret
=
x
calloc
(
1
,
sizeof
(
int
));
ret
[
0
]
=
cursor
;
lc
=
1
;
}
else
{
ret
=
util_
malloc
(
lc
*
sizeof
(
int
));
ret
=
x
malloc
(
lc
*
sizeof
(
int
));
lc
=
0
;
for
(
current
=
first
;
current
->
next
!=
NULL
;
current
=
current
->
next
)
ret
[
lc
++
]
=
current
->
data
;
...
...
@@ -494,7 +494,7 @@ util_find_env (const char *variable)
if
(
environment
==
NULL
)
{
environment
=
util_
malloc
(
sizeof
(
node
));
environment
=
x
malloc
(
sizeof
(
node
));
environment
->
env_entry
.
var
=
NULL
;
environment
->
env_entry
.
set
=
0
;
environment
->
env_entry
.
value
=
NULL
;
...
...
@@ -802,7 +802,7 @@ util_escape_percent (char **str)
return
;
/* nothing to do */
/* expand the string */
newstr
=
util_
malloc
(
strlen
(
*
str
)
+
1
+
count
);
newstr
=
x
malloc
(
strlen
(
*
str
)
+
1
+
count
);
/* and escape percent signs */
p
=
newstr
;
...
...
@@ -1013,25 +1013,3 @@ util_tempfile(char **namep)
return
fd
;
}
void
*
util_malloc
(
size_t
size
)
{
void
*
p
=
malloc
(
size
);
if
(
!
p
)
{
util_error
(
"not enough memory (allocating %d bytes)"
,
size
);
abort
();
}
return
p
;
}
void
*
util_calloc
(
size_t
nitems
,
size_t
size
)
{
void
*
p
;
size
*=
nitems
;
p
=
util_malloc
(
size
);
memset
(
p
,
0
,
size
);
return
p
;
}
...
...
Please
register
or
sign in
to post a comment