shithub: riscv

Download patch

ref: 6042c7b2740781ca32509f9e7b7ab0daee16d810
parent: f7486cc764978365d3473ab38aec33da00319b64
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Feb 9 18:51:04 EST 2025

ip/pppoe: get rid of horrible hexdump() function

--- a/sys/src/cmd/ip/pppoe.c
+++ b/sys/src/cmd/ip/pppoe.c
@@ -73,7 +73,6 @@
 
 void dumppkt(uchar*);
 uchar *findtag(uchar*, int, int*, int);
-void hexdump(uchar*, int);
 int malformed(uchar*, int, int);
 int pppoe(char*);
 void execppp(int);
@@ -806,27 +805,4 @@
 	}
 
 	return 0;
-}
-
-void
-hexdump(uchar *a, int na)
-{
-	int i;
-	char buf[80];
-
-	buf[0] = '\0';
-	for(i=0; i<na; i++){
-		sprint(buf+strlen(buf), " %.2ux", a[i]);
-		if(i%16 == 7)
-			sprint(buf+strlen(buf), " --");
-		if(i%16==15){
-			sprint(buf+strlen(buf), "\n");
-			write(2, buf, strlen(buf));
-			buf[0] = 0;
-		}
-	}
-	if(i%16){
-		sprint(buf+strlen(buf), "\n");
-		write(2, buf, strlen(buf));
-	}
 }
--