aboutsummaryrefslogtreecommitdiffstats
path: root/epan/osi-utils.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-12-21 00:43:00 +0000
committerGuy Harris <guy@alum.mit.edu>2012-12-21 00:43:00 +0000
commita9f4da4549bd4244697dac69bd7b74109f842e8a (patch)
tree1251e9461314a630acfadbe36333d7c468a56623 /epan/osi-utils.c
parente43dba76e0e77c19af56b89be62df918d750c676 (diff)
Clean up white space.
Add a return where I presume it was intended to be - a 4-octet address is completely handled in that if clause, so there's no reason to fall through. Fix a comment. svn path=/trunk/; revision=46646
Diffstat (limited to 'epan/osi-utils.c')
-rw-r--r--epan/osi-utils.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/epan/osi-utils.c b/epan/osi-utils.c
index 6aa79268aa..d077141313 100644
--- a/epan/osi-utils.c
+++ b/epan/osi-utils.c
@@ -186,26 +186,25 @@ print_area_buf(const guint8 *ad, int length, gchar *buf, int buf_len)
g_snprintf(buf, buf_len, "%02x.%02x%02x", ad[0], ad[1], ad[2] );
return;
}
- if(length == 4)
- {
+ if ( length == 4 ) {
g_snprintf(buf, buf_len, "%02x%02x%02x%02x", ad[0], ad[1], ad[2], ad[3] );
- }
- while ( tmp < length / 4 ) { /* 16/4==4 > four Octets left to print */
- cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
- cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
+ return;
+ }
+ while ( tmp < length / 4 ) { /* 16/4==4 > four Octets left to print */
+ cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
+ cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
+ cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
+ cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x.", ad[tmp++] );
+ }
+ if ( 1 == tmp ) { /* Special case for Designated IS */
+ cur--;
+ g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "-%02x", ad[tmp] );
+ }
+ else {
+ for ( ; tmp < length; ) { /* print the rest without dot or dash */
cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
- cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x.", ad[tmp++] );
}
- if ( 1 == tmp ) { /* Special case for Designated IS */
- cur--;
- g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "-%02x", ad[tmp] );
- }
- else {
- for ( ; tmp < length; ) { /* print the rest without dot */
- cur += g_snprintf(cur, (gulong) (buf_len-(cur-buf)), "%02x", ad[tmp++] );
- }
- }
-
+ }
}
} /* print_area_buf */