Changeset 5053 for trunk/tools/common/kDump.cpp
- Timestamp:
- Feb 2, 2001, 9:45:42 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/common/kDump.cpp
r4360 r5053 1 /* $Id: kDump.cpp,v 1. 1 2000-10-02 04:07:44bird Exp $1 /* $Id: kDump.cpp,v 1.2 2001-02-02 08:45:41 bird Exp $ 2 2 * 3 3 * Generic dumper... … … 39 39 for (argi = 1; argi < argc; argi++) 40 40 { 41 FILE *phFile = fopen(argv[argi], "rb"); 42 if (phFile) 41 try 43 42 { 44 kFileFormatBase *pFile = NULL; 45 try {pFile = new kFilePE(phFile);} 43 kFile file(argv[argi]); 44 kFileFormatBase * pFile = NULL; 45 try {pFile = new kFilePE(&file);} 46 46 catch (int err) 47 47 { 48 //try {pFile = new kFileLX(phFile);}49 //catch (int err)48 try {pFile = new kFileLX(&file);} 49 catch (int err) 50 50 { 51 try {pFile = new kFileDef( phFile);}51 try {pFile = new kFileDef(&file);} 52 52 catch (int err) 53 53 { … … 66 66 delete pFile; 67 67 } 68 fclose(phFile);69 68 } 70 else69 catch (int err) 71 70 { 72 fprintf(stderr, "Fatal: Failed to open file %s .\n", argv[argi]);71 fprintf(stderr, "Fatal: Failed to open file %s err=%d.\n", argv[argi], err); 73 72 return -1; 74 73 }
Note:
See TracChangeset
for help on using the changeset viewer.