From: Memphiz Date: Mon, 11 Jul 2011 17:16:13 +0000 (+0200) Subject: [fix] - fix allocation of if list for osx X-Git-Tag: upstream/1.9.6^2~347^2 X-Git-Url: https://git.piment-noir.org/?p=deb_libnfs.git;a=commitdiff_plain;h=41a6209bef3ab460c1da36d8ba23c2b77da30bf1 [fix] - fix allocation of if list for osx - removed one unneeded header in examples/nfsclient-bcast.c which was breaking build under osx --- diff --git a/examples/nfsclient-bcast.c b/examples/nfsclient-bcast.c index 89b1376..498e0e7 100644 --- a/examples/nfsclient-bcast.c +++ b/examples/nfsclient-bcast.c @@ -32,7 +32,6 @@ #include #include "libnfs.h" #include "libnfs-raw.h" -#include "libnfs-private.h" #include "libnfs-raw-mount.h" #include "libnfs-raw-portmap.h" @@ -128,7 +127,7 @@ int main(int argc _U_, char *argv[] _U_) ifc.ifc_buf = NULL; ifc.ifc_len = size; - while (ifc.ifc_len == size) { + while(ifc.ifc_len > (size - sizeof(struct ifreq))) { size *= 2; free(ifc.ifc_buf); diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c index faf8545..0a57c7b 100644 --- a/lib/libnfs-sync.c +++ b/lib/libnfs-sync.c @@ -1227,7 +1227,7 @@ struct nfs_server_list *nfs_find_local_servers(void) ifc.ifc_buf = NULL; ifc.ifc_len = size; - while (ifc.ifc_len == size) { + while(ifc.ifc_len > (size - sizeof(struct ifreq))) { size *= 2; free(ifc.ifc_buf);