ppc64: Don't set Kp bit on SLB
[openbios.git] / utils / devbios / comp.c
blob9d2acb147fcd64dd5dd54a3e9c802d3d852e649b
1 /* Simple utility to compare 2 files.
2 * Diff or cmp are not sufficient, when
3 * comparing bioses :-)
5 * Copyright (c) 1998-2000 by Stefan Reinauer
6 */
9 #include <stdio.h>
11 int main (int argc, char *argv[])
13 FILE *eins,*zwei;
14 int a,b,i=0,flag=0;
16 if(argv[1]==NULL||argv[2]==NULL) {
17 printf ("Usage: %s file1 file2\n %s compares two files.\n",argv[0],argv[0]);
18 return 0;
20 eins=fopen(argv[1],"r");
21 zwei=fopen(argv[2],"r");
23 if (eins==NULL) {
24 printf ("File %s not found or unreadable.\n",argv[1]);
25 return 0;
27 if (zwei==NULL) {
28 printf ("File %s not found or unreadable.\n",argv[2]);
29 fclose (eins);
30 return 0;
33 while (!feof(eins)) {
34 a=fgetc(eins);
35 b=fgetc(zwei);
36 if (flag==0 && (a==-1||b==-1) && (a!=-1||b!=-1)) {
37 printf ("One file ended. Printing the rest of the other.\n");
38 flag=1;
40 if(a!=b) printf ("0x%06x: 0x%02x -> 0x%02x\n",i,a,b);
41 i++;
44 fclose(eins);
45 fclose(zwei);
46 return 0;