e09113f249
While here: set LICENSE, add comments to patches.
35 lines
1,017 B
Text
35 lines
1,017 B
Text
$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';
|