libiproute: handle table ids larger than 255
[oweals/busybox.git] / networking / libiproute / rtm_map.c
index 3bab53baf2eb4e4c13e802a868acd6fab680c8f8..c763da049c619535e6fee3465d32acbba5f627dd 100644 (file)
@@ -12,7 +12,7 @@
 #include "rt_names.h"
 #include "utils.h"
 
-const char* FAST_FUNC rtnl_rtntype_n2a(int id, char *buf)
+const char* FAST_FUNC rtnl_rtntype_n2a(int id)
 {
        switch (id) {
        case RTN_UNSPEC:
@@ -40,9 +40,7 @@ const char* FAST_FUNC rtnl_rtntype_n2a(int id, char *buf)
        case RTN_XRESOLVE:
                return "xresolve";
        default:
-               /* buf is SPRINT_BSIZE big */
-               sprintf(buf, "%d", id);
-               return buf;
+               return itoa(id);
        }
 }