"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "utils/bin2byte.c" between
bed-3.0.3.src.tar.xz and bed-3.1.0.src.tar.xz

About: bed is an adjustable data format binary editor.

bin2byte.c  (bed-3.0.3.src.tar.xz):bin2byte.c  (bed-3.1.0.src.tar.xz)
skipping to change at line 39 skipping to change at line 39
}; };
if(!(infp=fopen(argv[1],"rb"))) { if(!(infp=fopen(argv[1],"rb"))) {
fprintf(stderr,"Can't open %s for reading\n",argv[1]); fprintf(stderr,"Can't open %s for reading\n",argv[1]);
exit(2); exit(2);
} }
if(!(uitfp=fopen(argv[3],"wb"))) { if(!(uitfp=fopen(argv[3],"wb"))) {
fprintf(stderr,"Can't open %s for writing\n",argv[3]); fprintf(stderr,"Can't open %s for writing\n",argv[3]);
exit(2); exit(2);
} }
fprintf(uitfp,"unsigned char %s[] = {",argv[2]); fprintf(uitfp,"const unsigned char %s[] = {",argv[2]);
while((ch=getc(infp))!=EOF) { while((ch=getc(infp))!=EOF) {
if(isalnum(ch)) if(isalnum(ch))
fprintf(uitfp,"\'%c\',",ch); fprintf(uitfp,"\'%c\',",ch);
else else
fprintf(uitfp,"0x%x,",ch); fprintf(uitfp,"0x%x,",ch);
} }
if(argc==4) if(argc==4)
putc('0',uitfp); putc('0',uitfp);
fputs("};\n",uitfp); fputs("};\n",uitfp);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)