chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus-policy: append items rather than prepending them
[elogind.git]
/
src
/
nss-mymachines
/
nss-mymachines.c
diff --git
a/src/nss-mymachines/nss-mymachines.c
b/src/nss-mymachines/nss-mymachines.c
index abeb8253c3c2fa4781e8e8ac1f6901160f27f17b..9476ad1694f2be8d52a6613e46692786c5541b6b 100644
(file)
--- a/
src/nss-mymachines/nss-mymachines.c
+++ b/
src/nss-mymachines/nss-mymachines.c
@@
-289,10
+289,7
@@
enum nss_status _nss_mymachines_gethostbyname3_r(
alen = FAMILY_ADDRESS_SIZE(af);
l = strlen(name);
alen = FAMILY_ADDRESS_SIZE(af);
l = strlen(name);
- ms = ALIGN(l+1) +
- sizeof(char*) +
- (c > 0 ? c : 1) * ALIGN(alen) +
- (c > 0 ? c+1 : 2) * sizeof(char*);
+ ms = ALIGN(l+1) + c * ALIGN(alen) + (c+2) * sizeof(char*);
if (buflen < ms) {
*errnop = ENOMEM;
if (buflen < ms) {
*errnop = ENOMEM;