From fac48856087d11627bb7c2b78776529ceadc213a Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Wed, 20 Apr 2011 16:29:42 +0200 Subject: Improve readability of classid string representation 1: is more readable than 01: --- lib/route/classid.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/route/classid.c b/lib/route/classid.c index 6af0ee3..abed244 100644 --- a/lib/route/classid.c +++ b/lib/route/classid.c @@ -106,7 +106,7 @@ static char *name_lookup(const uint32_t classid) * @return The destination buffer or the type encoded in hexidecimal * form if no match was found. */ -char * rtnl_tc_handle2str(uint32_t handle, char *buf, size_t len) +char *rtnl_tc_handle2str(uint32_t handle, char *buf, size_t len) { if (TC_H_ROOT == handle) snprintf(buf, len, "root"); @@ -120,11 +120,11 @@ char * rtnl_tc_handle2str(uint32_t handle, char *buf, size_t len) if ((name = name_lookup(handle))) snprintf(buf, len, "%s", name); else if (0 == TC_H_MAJ(handle)) - snprintf(buf, len, ":%02x", TC_H_MIN(handle)); + snprintf(buf, len, ":%x", TC_H_MIN(handle)); else if (0 == TC_H_MIN(handle)) - snprintf(buf, len, "%02x:", TC_H_MAJ(handle) >> 16); + snprintf(buf, len, "%x:", TC_H_MAJ(handle) >> 16); else - snprintf(buf, len, "%02x:%02x", + snprintf(buf, len, "%x:%x", TC_H_MAJ(handle) >> 16, TC_H_MIN(handle)); } -- cgit v0.12