[netcf-devel] [PATCH] remove duplicate routines

Adam Stokes astokes at fedoraproject.org
Fri Sep 17 14:54:37 UTC 2010


---
 src/netcf_win.c |   14 +-------------
 src/netcf_win.h |    2 --
 2 files changed, 1 insertions(+), 15 deletions(-)

diff --git a/src/netcf_win.c b/src/netcf_win.c
index 166465e..e443614 100644
--- a/src/netcf_win.c
+++ b/src/netcf_win.c
@@ -13,7 +13,7 @@ PMIB_IPADDRTABLE _get_ip_addr_table(PMIB_IPADDRTABLE ipAddrTable) {
     DWORD r = 0;
     DWORD buf = 0;
 
-    ipAddrTable = (PMIB_IPADDRTABLE) sizeof (MIB_IPADDRTABLE);
+    ipAddrTable = (PMIB_IPADDRTABLE) malloc(sizeof (MIB_IPADDRTABLE));
     if (GetIpAddrTable(ipAddrTable, &buf, 0) == ERROR_INSUFFICIENT_BUFFER) {
 	free(ipAddrTable);
 	ipAddrTable = (PMIB_IPADDRTABLE) malloc(buf);
@@ -215,18 +215,6 @@ void drv_close(struct netcf *ncf) {
 #endif
 }
 
-int xasprintf(char **strp, const char *format, ...) {
-  va_list args;
-  int result;
-
-  va_start (args, format);
-  result = vasprintf (strp, format, args);
-  va_end (args);
-  if (result < 0)
-      *strp = NULL;
-  return result;
-}
-
 /* Create a new netcf if instance for interface NAME */
 struct netcf_if *make_netcf_if(struct netcf *ncf, char *name) {
     int r;
diff --git a/src/netcf_win.h b/src/netcf_win.h
index 845082a..1b88772 100644
--- a/src/netcf_win.h
+++ b/src/netcf_win.h
@@ -42,9 +42,7 @@
 #include "ref.h"
 #include "list.h"
 
-
 struct netcf_if *make_netcf_if(struct netcf *ncf, char *name);
-int xasprintf(char **strp, const char *format, ...);
 
 /* structure return of interface table */
 PMIB_IFTABLE _get_if_table(PMIB_IFTABLE intfTable);
-- 
1.7.2.3



More information about the netcf-devel mailing list