mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 02:54:29 +08:00
Fix _mysql.escape_string()
This commit is contained in:
2
_mysql.c
2
_mysql.c
@ -1079,7 +1079,7 @@ _mysql_escape_string(
|
|||||||
PyObject *str;
|
PyObject *str;
|
||||||
char *in, *out;
|
char *in, *out;
|
||||||
int len, size;
|
int len, size;
|
||||||
if (!PyArg_ParseTuple(args, "y#:escape_string", &in, &size)) return NULL;
|
if (!PyArg_ParseTuple(args, "s#:escape_string", &in, &size)) return NULL;
|
||||||
str = PyBytes_FromStringAndSize((char *) NULL, size*2+1);
|
str = PyBytes_FromStringAndSize((char *) NULL, size*2+1);
|
||||||
if (!str) return PyErr_NoMemory();
|
if (!str) return PyErr_NoMemory();
|
||||||
out = PyBytes_AS_STRING(str);
|
out = PyBytes_AS_STRING(str);
|
||||||
|
Reference in New Issue
Block a user