patch-2.1.101 linux/arch/ppc/kernel/find_name.c

Next file: linux/arch/ppc/kernel/head.S
Previous file: linux/arch/ppc/kernel/chrp_time.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.100/linux/arch/ppc/kernel/find_name.c linux/arch/ppc/kernel/find_name.c
@@ -1,16 +1,16 @@
 #include <stdio.h>
 #include <asm/page.h>
 #include <sys/mman.h>
+#include <strings.h>
 /*
  * Finds a given address in the System.map and prints it out
  * with its neighbors.  -- Cort
  */
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
 	unsigned long addr, cmp, i;
 	FILE *f;
-	char *ptr;
 	char s[256], last[256];
 	
 	if ( argc < 2 )
@@ -21,7 +21,7 @@
 
 	for ( i = 1 ; argv[i] ; i++ )
 	{
-		sscanf( argv[i], "%0x", &addr );
+		sscanf( argv[i], "%0lx", &addr );
 		/* adjust if addr is relative to kernelbase */
 		if ( addr < PAGE_OFFSET )
 			addr += PAGE_OFFSET;
@@ -35,7 +35,7 @@
 		while ( !feof(f) )
 		{
 			fgets(s, 255 , f);
-			sscanf( s, "%0x", &cmp );
+			sscanf( s, "%0lx", &cmp );
 			if ( addr < cmp )
 				break;
 			strcpy( last, s);
@@ -44,4 +44,5 @@
 		printf( "%s", last);
 	}		
 	fclose(f);
+	return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov