summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mactelnet.c18
-rw-r--r--protocol.c2
2 files changed, 19 insertions, 1 deletions
diff --git a/mactelnet.c b/mactelnet.c
index 236d5f9..37fb026 100644
--- a/mactelnet.c
+++ b/mactelnet.c
@@ -439,10 +439,28 @@ int main (int argc, char **argv) {
{
char *p = argv[optind];
int colons = 0;
+ int dashs = 0;
while (*p++) {
if (*p == ':') {
colons++;
}
+ else if (*p == '-') {
+ dashs++;
+ }
+ }
+
+ /*
+ * Windows users often enter macs with dash instead
+ * of colon.
+ */
+ if (colons == 0 && dashs == 5) {
+ p = argv[optind];
+ while (*p++) {
+ if (*p == '-') {
+ *p = ':';
+ }
+ }
+ colons = dashs;
}
if (colons != 5) {
diff --git a/protocol.c b/protocol.c
index cd6b3c3..acf0b0b 100644
--- a/protocol.c
+++ b/protocol.c
@@ -75,7 +75,7 @@ int add_control_packet(struct mt_packet *packet, enum mt_cptype cptype, void *cp
/* Something is really wrong. Packets should never become over 1500 bytes */
if (packet->size + MT_CPHEADER_LEN + data_len > MT_PACKET_LEN) {
- fprintf(stderr, "addControlPacket: ERROR, too large packet. Exceeds %d bytes\n", MT_PACKET_LEN);
+ fprintf(stderr, "add_control_packet: ERROR, too large packet. Exceeds %d bytes\n", MT_PACKET_LEN);
return -1;
//exit(1);
}