Fix off-by-one bug in memmove() call in bytes_insert().

Fix by Pete Shinners (for his own bug :-).
This commit is contained in:
Guido van Rossum 2007-02-27 20:57:45 +00:00
parent 6f8fe151da
commit 4fc8ae424f
1 changed files with 1 additions and 1 deletions

View File

@ -2313,7 +2313,7 @@ bytes_insert(PyBytesObject *self, PyObject *args)
}
if (where > n)
where = n;
memmove(self->ob_bytes + where + 1, self->ob_bytes + where, n - where + 1);
memmove(self->ob_bytes + where + 1, self->ob_bytes + where, n - where);
self->ob_bytes[where] = value;
Py_RETURN_NONE;