Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, i use irrXML 1.2 in my code. Function createIrrXMLReader should return 0. My code looks like this: IrrXMLReader* xml = createIrrXMLReader(config.c_str()); if(xml == NULL or xml == 0) { cerr << "\n\nError : Cannot open config file" << endl; exit(0); } but when i run the program, even if the config file doesn't exist, the program still runs. It just has no XML entries. Am i doing something wrong? I am on mac OS X 10.4.10 PPC. |
||||
|
ah, interesting. That looks like a bug, but at least it won't do anything more evil like crashing. :) |
||||
|
[quote=3]ah, interesting. That looks like a bug, but at least it won't do anything more evil like crashing. :)[/quote] Well in my case it's as bad as crashing because the user will have no clue why it fails if he does a typo when passing the config file name as argument... anyway, do you think you'll have time to look at it? |
||||
|
Hi, i took a look at the source and it doesn't seem like there is a check at all
If the file does not exist, CFileReadCallBack::File will be NULL, but CFileReadCallBack will not and CXMLReaderImpl neither. I don't think 'new' ever returns NULL unless there is not enough memory perhaps This bug can be fixed by making the function:
I didn't look at the other simialr ones though. |
|