We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
tlXMLParser.cc:94:read(...,...) return -1
read(...)
size_t
The code is the following:
size_t read (char *data, size_t n) { try { if (mp_progress.get ()) { mp_progress->set (mp_stream->pos ()); } size_t n0 = n; for (const char *rd = 0; n > 0 && (rd = mp_stream->get (1)) != 0; --n) { *data++ = *rd; } if (n0 == n) { return -1; } else { return n0 - n; } } catch (tl::Exception &ex) { m_error = ex.msg (); m_has_error = true; return -1; } }
The return type of read is size_t, which cannot be negative. return -1 is therefore equal to return UINT_MAX.
read
return -1
return UINT_MAX
I think throwing an exception is better.
The text was updated successfully, but these errors were encountered:
This is only for EXPAT binding, but it is worth fixing it.
Thanks.
Matthias
Sorry, something went wrong.
Fixing issue #1750 and issue #1751
27073cb
Merge pull request #1752 from KLayout/bugfix/issue-1750-1751
054fd09
Successfully merging a pull request may close this issue.
The code is the following:
The return type of
read
issize_t
, which cannot be negative.return -1
is therefore equal toreturn UINT_MAX
.I think throwing an exception is better.
The text was updated successfully, but these errors were encountered: