From 41a6209bef3ab460c1da36d8ba23c2b77da30bf1 Mon Sep 17 00:00:00 2001 From: Memphiz Date: Mon, 11 Jul 2011 19:16:13 +0200 Subject: [PATCH] [fix] - fix allocation of if list for osx - removed one unneeded header in examples/nfsclient-bcast.c which was breaking build under osx --- examples/nfsclient-bcast.c | 3 +-- lib/libnfs-sync.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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); -- 2.34.1