From 1d4ad1decc539c9729b592e6050460d6487c95f4 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 7 Dec 2006 00:25:54 +0100 Subject: Imported from util-linux-2.11q tarball. --- sys-utils/readprofile.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sys-utils/readprofile.c') diff --git a/sys-utils/readprofile.c b/sys-utils/readprofile.c index 398ebb4ce..052954f95 100644 --- a/sys-utils/readprofile.c +++ b/sys-utils/readprofile.c @@ -29,6 +29,8 @@ * - byte order auto-detection and -n option * 2001-11-09 Werner Almesberger * - skip step size (index 0) + * 2002-03-09 John Levon + * - make maplineno do something */ #include @@ -234,16 +236,17 @@ main (int argc, char **argv) { exit(1); } - while(fgets(mapline,S_LEN,map)) { - if (sscanf(mapline,"%lx %s %s",&fn_add,mode,fn_name)!=3) { + while (fgets(mapline,S_LEN,map)) { + if (sscanf(mapline,"%lx %s %s",&fn_add,mode,fn_name) != 3) { fprintf(stderr,_("%s: %s(%i): wrong map line\n"), - prgname,mapFile, maplineno); + prgname, mapFile, maplineno); exit(1); } if (!strcmp(fn_name,"_stext")) /* only elf works like this */ { - add0=fn_add; + add0 = fn_add; break; } + maplineno++; } if (!add0) { @@ -255,7 +258,7 @@ main (int argc, char **argv) { /* * Main loop. */ - while(fgets(mapline,S_LEN,map)) { + while (fgets(mapline,S_LEN,map)) { unsigned int this=0; if (sscanf(mapline,"%lx %s %s",&next_add,mode,next_name)!=3) { @@ -289,6 +292,8 @@ main (int argc, char **argv) { this,fn_name,this/(double)fn_len); } fn_add=next_add; strcpy(fn_name,next_name); + + maplineno++; } /* trailer */ if (optVerbose) -- cgit v1.2.3-55-g7522