chiark / gitweb /
journal: bump RLIMIT_NOFILE when journal files to 16K (if possible)
[elogind.git] / src / nss-resolve / nss-resolve.c
index 39b73203d26afbc351f1e9d60c15233a595ada1f..3f32ed06507df81eb72a7aa0c975b27cf5cba52e 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "sd-bus.h"
 #include "bus-util.h"
-#include "bus-errors.h"
+#include "bus-common-errors.h"
 #include "macro.h"
 #include "nss-util.h"
 #include "util.h"
@@ -404,10 +404,7 @@ enum nss_status _nss_resolve_gethostbyname3_r(
         alen = FAMILY_ADDRESS_SIZE(af);
         l = strlen(canonical);
 
-        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;