properly creating input file stream
This commit is contained in:
1 parent
a2acb832dd
commit
3097feb9fb
1 file changed
+7
-1
+7
-1
@@ -30,7 +30,13 @@ int main(int argc, char * argv[])
|
||||
}
|
||||
}
|
||||
|
||||
ifstream ifs(optarg);
|
||||
ifstream ifs;
|
||||
ifs.open(argv[optind], ios::binary);
|
||||
if (!ifs.is_open())
|
||||
{
|
||||
cerr << "Error opening input file: '" << argv[optind] << "'";
|
||||
return 2;
|
||||
}
|
||||
refptr< vector<unichar_t> > ucs_str = deserialize(encoding, ifs);
|
||||
if (ucs_str.isNull())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user