mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 09:49:18 -04:00
Be a little more sensible when allocating memory to hold the netstat tokens.
This commit is contained in:
parent
e43640bbfa
commit
c10f8a540c
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=113034
4 changed files with 6 additions and 4 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
PORTNAME= gnomenettool
|
||||
PORTVERSION= 0.99.1
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= net gnome
|
||||
MASTER_SITES= ${MASTER_SITE_GNOME}
|
||||
MASTER_SITE_SUBDIR= sources/gnome-nettool/0.99
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--- src/info.c.orig Fri Jun 11 07:14:17 2004
|
||||
+++ src/info.c Mon Jul 5 15:25:09 2004
|
||||
+++ src/info.c Tue Jul 6 01:19:20 2004
|
||||
@@ -37,6 +37,9 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -132,7 +132,7 @@
|
|||
compressed, multicast,
|
||||
tx_bytes, tx_pkt, tx_error, tx_drop, tx_fifo, collissions);
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ tokens = (gchar **) g_malloc0 ((sizeof (char)) * (strlen (line) + 2));
|
||||
+ tokens = (gchar **) g_malloc0 (sizeof (gchar *) * 12);
|
||||
+ p = strtok (line, " \t\n");
|
||||
+ /* We only care about 11 fields for now */
|
||||
+ for (i = 0; i < 11 && p; i++, p = strtok (NULL, " \t\n")) {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
PORTNAME= gnomenettool
|
||||
PORTVERSION= 0.99.1
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= net gnome
|
||||
MASTER_SITES= ${MASTER_SITE_GNOME}
|
||||
MASTER_SITE_SUBDIR= sources/gnome-nettool/0.99
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--- src/info.c.orig Fri Jun 11 07:14:17 2004
|
||||
+++ src/info.c Mon Jul 5 15:25:09 2004
|
||||
+++ src/info.c Tue Jul 6 01:19:20 2004
|
||||
@@ -37,6 +37,9 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -132,7 +132,7 @@
|
|||
compressed, multicast,
|
||||
tx_bytes, tx_pkt, tx_error, tx_drop, tx_fifo, collissions);
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ tokens = (gchar **) g_malloc0 ((sizeof (char)) * (strlen (line) + 2));
|
||||
+ tokens = (gchar **) g_malloc0 (sizeof (gchar *) * 12);
|
||||
+ p = strtok (line, " \t\n");
|
||||
+ /* We only care about 11 fields for now */
|
||||
+ for (i = 0; i < 11 && p; i++, p = strtok (NULL, " \t\n")) {
|
||||
|
|
Loading…
Add table
Reference in a new issue