Patch from Denis Vlasenko to constify things and fix a few typos.
[oweals/busybox.git] / networking / libiproute / ll_proto.c
index 9b5260b3285a5ea95796be1a4d56653a681a6df5..873253050d2832e0f7dde468ef0ff5209ebe530b 100644 (file)
@@ -90,25 +90,25 @@ __PF(ECONET,econet)
 #undef __PF
 
 
-char * ll_proto_n2a(unsigned short id, char *buf, int len)
+const char * ll_proto_n2a(unsigned short id, char *buf, int len)
 {
-        int i;
+       int i;
 
        id = ntohs(id);
 
-        for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) {
-                 if (llproto_names[i].id == id)
+       for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) {
+                if (llproto_names[i].id == id)
                        return llproto_names[i].name;
        }
-        snprintf(buf, len, "[%d]", id);
-        return buf;
+       snprintf(buf, len, "[%d]", id);
+       return buf;
 }
 
 int ll_proto_a2n(unsigned short *id, char *buf)
 {
-        int i;
-        for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) {
-                 if (strcasecmp(llproto_names[i].name, buf) == 0) {
+       int i;
+       for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) {
+                if (strcasecmp(llproto_names[i].name, buf) == 0) {
                         *id = htons(llproto_names[i].id);
                         return 0;
                 }