Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Accessing mac address[6] #45

Closed
orinem opened this issue Aug 2, 2015 · 1 comment
Closed

Accessing mac address[6] #45

orinem opened this issue Aug 2, 2015 · 1 comment

Comments

@orinem
Copy link
Contributor

orinem commented Aug 2, 2015

Surely, a MAC address is 6 bytes and should be addressed with [0]..[5].

macToString in WaveHelper.mm was adding the extra byte to the string. The extra byte was annoying in the display, so I fixed it in the one place (diff inline later).

It also seems to be a problem in WaveScanner.mm with:

define mToS(m) [NSString stringWithFormat:@"%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", m[0], m[1], m[2], m[3], m[4], m[5], m[6]]

It's not likely to cause a crash, but displaying 7 bytes of BSSID is weird!

EDIT: fixed code block.

diff --git a/Sources/Core/WaveHelper.m b/Sources/Core/WaveHelper.m
index bfa57c1..71b3e82 100644
--- a/Sources/Core/WaveHelper.m
+++ b/Sources/Core/WaveHelper.m
@@ -124,7 +124,7 @@ static GPSInfoController *_gc;
 + (NSString*) macToString:(UInt8*)m {
     if (!m)
         return nil;
-   return [NSString stringWithFormat:@"%.2X:%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", m[0], m[1], m[2], m[3], m[4], m[5], m[6]];
+    return [NSString stringWithFormat:@"%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", m[0], m[1], m[2], m[3], m[4], m[5]];
 }

 // Returns the vendor for a specific MAC-Address
orinem added a commit to orinem/KisMac2 that referenced this issue Aug 2, 2015
ikorich added a commit that referenced this issue Aug 3, 2015
Issue #45: Only print 6 bytes for MAC addresses.
@ikorich
Copy link
Member

ikorich commented Aug 3, 2015

Done

@ikorich ikorich closed this as completed Aug 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants