[fix] - fix allocation of if list for osx
[deb_libnfs.git] / examples / nfsclient-bcast.c
index 89b1376aae9c9dcb1026202e732c680133ad42b3..498e0e7f4fcbad8c4b79ec84533cbe9d930cf849 100644 (file)
@@ -32,7 +32,6 @@
 #include <netdb.h>
 #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);