summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2007-06-12 00:26:28 +0000
committerStef Walter <stef@thewalter.net>2007-06-12 00:26:28 +0000
commitc55f85c2486207aae771e662d12581e3ff406a22 (patch)
treec38fb0bcaab18331272a9fc373b1d347ce03675f
parentebc135537083c0ad2b9aa47796c759eaa7f3995c (diff)
Fix some warnings.
-rw-r--r--Makefile2
-rw-r--r--athsta.c43
2 files changed, 2 insertions, 43 deletions
diff --git a/Makefile b/Makefile
index 21dcf17..f21b7cf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
athsta: athsta.c
- gcc -g -o athsta athsta.c
+ gcc -Wall -g -o athsta athsta.c
clean:
rm -f *.o
diff --git a/athsta.c b/athsta.c
index 178d2cc..793b599 100644
--- a/athsta.c
+++ b/athsta.c
@@ -97,48 +97,6 @@ printie(const char* tag, const uint8_t *ie, size_t ielen, int maxlen)
}
}
-/*
- * Copy the ssid string contents into buf, truncating to fit. If the
- * ssid is entirely printable then just copy intact. Otherwise convert
- * to hexadecimal. If the result is truncated then replace the last
- * three characters with "...".
- */
-static int
-copy_essid(char buf[], size_t bufsize, const u_int8_t *essid, size_t essid_len)
-{
- const u_int8_t *p;
- size_t maxlen;
- int i;
-
- if (essid_len > bufsize)
- maxlen = bufsize;
- else
- maxlen = essid_len;
- /* determine printable or not */
- for (i = 0, p = essid; i < maxlen; i++, p++) {
- if (*p < ' ' || *p > 0x7e)
- break;
- }
- if (i != maxlen) { /* not printable, print as hex */
- if (bufsize < 3)
- return 0;
- strlcpy(buf, "0x", bufsize);
- bufsize -= 2;
- p = essid;
- for (i = 0; i < maxlen && bufsize >= 2; i++) {
- sprintf(&buf[2+2*i], "%02x", p[i]);
- bufsize -= 2;
- }
- if (i != essid_len)
- memcpy(&buf[2+2*i-3], "...", 3);
- } else { /* printable, truncate as needed */
- memcpy(buf, essid, maxlen);
- if (maxlen != essid_len)
- memcpy(&buf[maxlen-3], "...", 3);
- }
- return maxlen;
-}
-
/* unaligned little endian access */
#define LE_READ_4(p) \
((u_int32_t) \
@@ -326,3 +284,4 @@ main (int argc, char* argv[])
return 0;
}
+