than the argument string size, copy as many bytes as will fit
(including a terminating '\0'), rather than not copying anything.
This to make it satisfy the C99 spec.
Bugfix candidate.
int_repr(): we've never had a buffer big enough to hold the largest
possible result on a 64-bit box. Now that we're using snprintf instead
of sprintf, this can lead to nonsense results instead of random stack
corruption.
to seealso, but does not add the "See also:" header or put the content in a
box in the HTML version.
Updated the description of \seeurl to better indicate when it should be used;
the old description was written before we had \seetitle.
- Change PREFIX to PREFIXES, which contains a sequence of prefix strings.
This is useful since we want to look for both Py and PY.
- Wrap a long line.
- Collect struct tags as well as typedef names. Since we generally only
use one of the other, that improves coverage.
- Make the script executable on Unix.
This could use a better approach to determine if a symbol is documented,
and could easily avoid keeping the massive string in memory. That would
take time to actually write more code, though, so we'll bail on that
for now.
vgetargskeywords(): Now that this routine is checking for bad input
(rather than dump core in some cases), some bad calls are raising errors
that previously "worked". This patch makes the error strings more
revealing, and changes the exceptions from SystemError to RuntimeError
(under the theory that SystemError is more of a "can't happen!" assert-
like thing, and so inappropriate for bad arguments to a public C API
function).
ZipFile.__del__(): call ZipFile.close(), like its docstring says it does.
ZipFile.close(): allow calling more than once (as all file-like objects
in Python should support).
pass the buffer length. Stop using it. It should be deprecated, but too
late in the release cycle to do that now.
New static format_float() does the same thing but requires passing the
buffer length too. Use it instead.
const char* instead of char*. The change is conceptually correct, and
indirectly fixes a compiler wng introduced when somebody else innocently
passed a const char* to this function.
seterror() uses a char array and a pointer to the current position in
that array. Use snprintf() and compute the amount of space left in
the buffer based on the current pointer position.
If it returns -1 (which indicates overflow on old Linux platforms and
perhaps on Windows) or size greater than buffer, write a message
indicating that the previous message was truncated.