diff options
author | Karel Zak | 2006-12-07 00:25:54 +0100 |
---|---|---|
committer | Karel Zak | 2006-12-07 00:25:54 +0100 |
commit | 1d4ad1decc539c9729b592e6050460d6487c95f4 (patch) | |
tree | c158c5f5baf15ea4bab5c05b2f6e2bdaca332c29 /sys-utils/readprofile.c | |
parent | Imported from util-linux-2.11o tarball. (diff) | |
download | kernel-qcow2-util-linux-1d4ad1decc539c9729b592e6050460d6487c95f4.tar.gz kernel-qcow2-util-linux-1d4ad1decc539c9729b592e6050460d6487c95f4.tar.xz kernel-qcow2-util-linux-1d4ad1decc539c9729b592e6050460d6487c95f4.zip |
Imported from util-linux-2.11q tarball.
Diffstat (limited to 'sys-utils/readprofile.c')
-rw-r--r-- | sys-utils/readprofile.c | 15 |
1 files changed, 10 insertions, 5 deletions
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 <wa@almesberger.net> * - skip step size (index 0) + * 2002-03-09 John Levon <moz@compsoc.man.ac.uk> + * - make maplineno do something */ #include <errno.h> @@ -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) |