properly creating input file stream

This commit is contained in:
Josh Holtrop 2010-03-29 20:21:38 -04:00
parent a2acb832dd
commit 3097feb9fb

View File

@ -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); refptr< vector<unichar_t> > ucs_str = deserialize(encoding, ifs);
if (ucs_str.isNull()) if (ucs_str.isNull())
{ {