Last modified: 2013-08-08 19:29:01 UTC
In zimlib (file.h), getArticle(size_type idx) is used to obtain the article having ID ad idx. However, when idx provided is not found in any article in the ZIM file, the function returns an article with the index as idx itself. Similar functions, like getArticle(char ns, const std::string& url) does not have this bug. If the required article is not found, they return an article with index 4294967295.(maximum value of unsigned int).(in other words, the default article, zim::Article(). ) I think getArticle(size_type idx) should also return zim::Article() instead of a modified version. Error reproduction code: zim::File file (filename.zim); std::cout<<"\n"<<file.getArticle(500).getIndex(); //Make sure the file has less than 500 articles. std::cout<<"\n"<<file.getArticle('X',"an_Article_which_doesn't_exist");