summaryrefslogtreecommitdiff
path: root/net/wimon/patches/patch-ab
blob: 5fa54b5428adbde40fc351b43b98b5c66548cf8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$NetBSD: patch-ab,v 1.2 2014/05/09 18:10:16 wiz Exp $

Only define MAX if it's not defined yet.
Remove unused variable.

--- wimon.c.orig	2004-07-13 03:38:18.000000000 -0400
+++ wimon.c	2014-05-09 12:55:58.000000000 -0400
@@ -50,7 +50,9 @@
 	wattroff(a, b); \
 } 
 
+#ifndef MAX
 #define MAX(a,b) ((a)<(b)?(b):(a))
+#endif
 #define ABS(a) ((a)>0?(a):-(a))
 #define INTERVAL (5)
 
@@ -165,7 +167,7 @@ print_str_items(WINDOW *cur_win, const c
 static void
 show_infos(struct wi_infos wi)
 {
-	int x, y, cur_w = COLS - (BORDER * 2) - 6; /* 6 == strlen("ssid: ") */
+	int x, cur_w = COLS - (BORDER * 2) - 6; /* 6 == strlen("ssid: ") */
 
 	wmove(main_win, 1, 2);
 
@@ -175,7 +177,7 @@ show_infos(struct wi_infos wi)
 	print_int_items(main_win, "tx rate (Mbps)", wi.curtxrate);
 	wprintw(main_win, " | ");
 	/* if stlen(ssid) > screen width, reduce ssid to window width - diff */
-	getyx(main_win, y, x);
+	x = getcurx(main_win);
 	x = cur_w - (x + wi.curssidlen);
 	if (x <= 0) {
 		wi.curssid[wi.curssidlen + x] = '\0';