From c55f85c2486207aae771e662d12581e3ff406a22 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 12 Jun 2007 00:26:28 +0000 Subject: Fix some warnings. --- Makefile | 2 +- athsta.c | 43 +------------------------------------------ 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; } + -- cgit v1.2.3