[Pkg-wmaker-commits] [wmifs] 25/118: Imported Debian patch 1.3b1-5
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Thu Aug 27 02:37:48 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmifs.
commit 5314a23cd01aab9c296f36b5e02159d748e0112f
Author: Ben Gertzfield <che at debian.org>
Date: Sun Aug 1 13:51:50 1999 -0700
Imported Debian patch 1.3b1-5
---
debian/changelog | 20 ++++++++++++++++++++
wmifs/wmifs.c | 39 +++++++++++++++++++++++++--------------
2 files changed, 45 insertions(+), 14 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 49e7e1e..2bb069d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,23 @@
+wmifs (1.3b1-5) unstable; urgency=low
+
+ * Remove annoying "heyho!" debugging printf that happened when one
+ does not have ppp. Fixes: #42297
+
+ -- Ben Gertzfield <che at debian.org> Sun, 1 Aug 1999 13:51:50 -0700
+
+wmifs (1.3b1-4) unstable; urgency=low
+
+ * Patch from Stephen Pitts to bump static buffer size from 128 to
+ #defined size (now 512). Fixes: #41746.
+
+ -- Ben Gertzfield <che at debian.org> Thu, 22 Jul 1999 07:22:39 -0700
+
+wmifs (1.3b1-3) unstable; urgency=low
+
+ * Bump MAX_STAT_DEVICES to 16. Closes: #37572
+
+ -- Ben Gertzfield <che at debian.org> Sun, 4 Jul 1999 10:07:03 -0700
+
wmifs (1.3b1-2) frozen unstable; urgency=low
* Make it so that a make clean does not cause debian/rules clean to
diff --git a/wmifs/wmifs.c b/wmifs/wmifs.c
index ebdf12b..5996b2b 100644
--- a/wmifs/wmifs.c
+++ b/wmifs/wmifs.c
@@ -74,6 +74,11 @@
----
Changes:
---
+ 07/21/1999 (Stephen Pitts, smpitts at midsouth.rr.com)
+ * Added new constant: BUFFER_SIZE to determine the size
+ of the buffer used in fgets() operations. Right now,
+ its at 512 bytes. Fixed crashing on my system when
+ one line of /proc/net/dev was longer than 128 bytes
04/05/1998 (Martijn Pieterse, pieterse at xs4all.nl)
* Changed the "middle of the waveform" line color
* Moved the RedrawWindow out of the main loop.
@@ -197,6 +202,8 @@
#define WMIFS_VERSION "1.2.1"
+/* the size of the buffer read from /proc/net/* */
+#define BUFFER_SIZE 512
/**********************/
/* External Variables */
/**********************/
@@ -295,7 +302,7 @@ void main(int argc, char *argv[]) {
|* wmifs_routine *|
\*******************************************************************************/
-#define MAX_STAT_DEVICES 4
+#define MAX_STAT_DEVICES 16
typedef struct {
@@ -340,7 +347,7 @@ void wmifs_routine(int argc, char **argv) {
long ipacket, opacket, istat, ostat;
- char temp[128];
+ char temp[BUFFER_SIZE];
char *p;
for (i=0; i<MAX_STAT_DEVICES; i++) {
@@ -562,7 +569,7 @@ void DrawActiveIFS(char *name) {
int get_statistics(char *devname, long *ip, long *op, long *is, long *os) {
FILE *fp;
- char temp[128];
+ char temp[BUFFER_SIZE];
char *p;
char *tokens = " |:\n";
int input, output;
@@ -596,8 +603,8 @@ int get_statistics(char *devname, long *ip, long *op, long *is, long *os) {
/* Read from /proc/net/dev the stats! */
fp = fopen("/proc/net/dev", "r");
- fgets(temp, 128, fp);
- fgets(temp, 128, fp);
+ fgets(temp, BUFFER_SIZE, fp);
+ fgets(temp, BUFFER_SIZE, fp);
input = -1;
output = -1;
@@ -614,7 +621,7 @@ int get_statistics(char *devname, long *ip, long *op, long *is, long *os) {
p = strtok(NULL, tokens);
} while (input == -1 || output == -1);
- while (fgets(temp, 128, fp)) {
+ while (fgets(temp, BUFFER_SIZE, fp)) {
if (strstr(temp, devname)) {
found = 0;
p = strtok(temp, tokens);
@@ -645,13 +652,13 @@ int get_statistics(char *devname, long *ip, long *op, long *is, long *os) {
int stillonline(char *ifs) {
FILE *fp;
- char temp[128];
+ char temp[BUFFER_SIZE];
int i;
i = 0;
fp = fopen("/proc/net/route", "r");
if (fp) {
- while (fgets(temp, 128, fp)) {
+ while (fgets(temp, BUFFER_SIZE, fp)) {
if (strstr(temp, ifs)) {
i = 1; /* Line is alive */
}
@@ -668,7 +675,7 @@ int stillonline(char *ifs) {
int checknetdevs(void) {
FILE *fd;
- char temp[128];
+ char temp[BUFFER_SIZE];
char *p;
int i=0,j;
int k;
@@ -685,11 +692,14 @@ int checknetdevs(void) {
fd = fopen("/proc/net/dev", "r");
if (fd) {
/* Skip the first 2 lines */
- fgets(temp, 128, fd);
- fgets(temp, 128, fd);
- while (fgets(temp, 128, fd)) {
+ fgets(temp, BUFFER_SIZE, fd);
+ fgets(temp, BUFFER_SIZE, fd);
+ while (fgets(temp, BUFFER_SIZE, fd)) {
p = strtok(temp, tokens);
-
+ if(p == NULL) {
+ printf("Barfed on: %s", temp);
+ break;
+ }
/* Skip dummy code */
if (!strncmp(p, "dummy", 5))
@@ -851,7 +861,8 @@ void get_ppp_stats(struct ppp_stats *cur) {
sprintf(req.ifr__name, "ppp%d", PPP_UNIT);
if (ioctl(ppp_h, SIOCGPPPSTATS, &req) < 0) {
- fprintf(stderr, "heyho!\n");
+/* fprintf(stderr, "heyho!\n"); */
+ /* This is an error of some sort! */
}
*cur = req.stats;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmifs.git
More information about the Pkg-wmaker-commits
mailing list