Re: trivial binary compare pgm

From: Mark Jenison <jenison_at_cig.mot.com>
Date: Thu Oct 16 1997 - 13:01:46 EDT

Al,

You're taking a big risk by submitting a coding sample to this crew ;-)

On Oct 16, 9:56am, Al Kossow wrote:
> Subject: trivial binary compare pgm
>
> here was something I hacked together when Dave and I
> were comparing ROM versions. catenate the images together
> and it will print out any bytes that differ
>
> #include <stdio.h>
> main(){
> FILE *f1, *f2;
> unsigned char c1, c2;
> unsigned int adr = 0;
>
> f1 = fopen("el2_prom","rb");
> f2 = fopen("el_prom","rb");
> while(!feof(f1)){
> c1 = getc(f1);
> c2 = getc(f2);
> if (c1 != c2){
> printf("%04x %02x %02x\n", adr, c1 ,c2);
> }
> adr++;
> }
> }
>
> ..not pretty but it got the job done
>-- End of excerpt from Al Kossow
Received on Thu Oct 16 10:02:34 1997

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2003 - 00:32:38 EDT