// start from the end and find all u" cases
size_t pos = len = linestr.size();
+ if(len>INT32_MAX/2) {
+ return true;
+ }
while((pos>0) && (pos = linestr.rfind("u\"", pos)) != std::string::npos) {
//printf("found doublequote at %d\n", pos);
if(fixAt(linestr, pos)) return true;
while( getline( inf, linestr)) {
no++;
if(fixLine(no, linestr)) {
- outf.close();
- fprintf(stderr, "%s:%d: Fixup failed by %s\n", infile.c_str(), no, prog.c_str());
- cleanup(outfile);
- return 1;
+ goto fail;
}
outf << linestr << '\n';
}
- return 0;
+ if(inf.eof()) {
+ return 0;
+ }
+fail:
+ outf.close();
+ fprintf(stderr, "%s:%d: Fixup failed by %s\n", infile.c_str(), no, prog.c_str());
+ cleanup(outfile);
+ return 1;
}
/**