-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignoring/truncating lines that are too long? #36
Comments
The file is processed line-by-line which enables I don't see any point in truncating lines that are too long for the buffer. It is reasonable to assume that all provided key/value pairs are important. So either the file is valid and can be parsed, or else it is not valid. If you need to support longer line lengths then you need to increase the buffer size. |
I'm thinking more for comment lines which can be safely ignored and has the chance of a user typing too much. |
I guess what I'm asking is it possible for the Ini file validation check to ignore lines that just comments? But continue to check actual key/value pairs for the pre-set buffer length limit. So end-users who are modifying the ini files can type whatever comments they want without fear of going over a pre-set buffer length (say 100 bytes) and inadvertently invalidating the ini file. thanks. |
Hello,
If I change line 423 in IniFile.cpp from:
return errorBufferTooSmall;
to
return errorNoError;
Would that result in the validate function not returning an error but instead just truncating lines that are too long (instead of returning an invalid file error)?
What's your reasoning behind invalidating the entire file if any lines are longer than the buffer length instead of just silently (or not silently) truncating them?
My thinking is if an end-user inadvertently has one line go over inibufferlen, the entire file is rejected, instead of just the offending line(s).
Thank you.
The text was updated successfully, but these errors were encountered: