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
a2a2c3a0
...
a2a2c3a0f04f3d89be139f8965a4be162bb3fdf6
authored
2001-12-17 03:41:18 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
* mailbox/address.c: Problem between signed and unsigned comparison.
1 parent
4d8dc3e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
23 deletions
ChangeLog
mailbox/address.c
ChangeLog
View file @
a2a2c3a
2001
-
12
-
16
Alain
Magloire
*
mailbox
/
address
.
c
:
Problem
between
signed
and
unsigned
comparison
.
2001
-
12
-
16
Sam
Roberts
*
TODO
:
updated
with
some
notes
about
the
doc
examples
...
...
mailbox/address.c
View file @
a2a2c3a
...
...
@@ -68,45 +68,46 @@ address_createv (address_t *a, const char *sv[], size_t len)
int
status
=
0
;
size_t
buflen
=
0
;
char
*
buf
=
0
;
in
t
i
;
size_
t
i
;
if
(
!
sv
)
if
(
!
sv
)
return
EINVAL
;
if
(
len
==
-
1
)
{
const
char
**
vp
=
sv
;
if
(
len
==
(
size_t
)
-
1
)
{
const
char
**
vp
=
sv
;
len
=
0
;
len
=
0
;
for
(
len
=
0
;
*
vp
;
vp
++
,
len
++
)
;
}
if
(
len
==
0
)
for
(
len
=
0
;
*
vp
;
vp
++
,
len
++
)
;
}
if
(
len
==
0
)
return
EINVAL
;
for
(
i
=
0
;
i
<
len
;
i
++
)
for
(
i
=
0
;
i
<
len
;
i
++
)
buflen
+=
strlen
(
sv
[
i
]);
buflen
+=
(
len
-
1
)
*
strlen
(
", "
);
buflen
+=
1
;
/*
termination null
*/
buflen
+=
(
len
-
1
)
*
strlen
(
", "
);
buflen
+=
1
;
/*
Termination null.
*/
buf
=
malloc
(
buflen
);
buf
=
malloc
(
buflen
);
if
(
!
buf
)
if
(
!
buf
)
return
ENOMEM
;
for
(
i
=
0
,
buf
[
0
]
=
'\0'
;
i
<
len
;
i
++
)
{
if
(
i
!=
0
)
strcat
(
buf
,
", "
);
for
(
i
=
0
,
buf
[
0
]
=
'\0'
;
i
<
len
;
i
++
)
{
if
(
i
!=
0
)
strcat
(
buf
,
", "
);
strcat
(
buf
,
sv
[
i
]);
}
strcat
(
buf
,
sv
[
i
]);
}
status
=
address_create
(
a
,
buf
);
status
=
address_create
(
a
,
buf
);
free
(
buf
);
free
(
buf
);
return
status
;
}
...
...
Please
register
or
sign in
to post a comment