From: Billy G. A. <bal...@us...> - 2001-09-30 22:44:17
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv6205 Modified Files: libpqmodule.c Log Message: 30SEP2001 bga Change PgQuoteString and PgQuoteByta so that unsigned char pointers are used instead of signed char pointers. Index: libpqmodule.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/libpqmodule.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** libpqmodule.c 2001/09/30 06:31:33 1.17 --- libpqmodule.c 2001/09/30 22:44:13 1.18 *************** *** 32,35 **** --- 32,37 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 30SEP2001 bga Change PgQuoteString and PgQuoteByta so that unsigned | + | char pointers are used instead of signed char pointers. | | 27SEP2001 bga Added different quoting/escaping if the result is to be | | used as part of a PostgreSQL array. | *************** *** 182,187 **** { int i, j, slen, byte, forArray=0; ! char *sin; ! char *sout; PyObject *result; --- 184,189 ---- { int i, j, slen, byte, forArray=0; ! unsigned char *sin; ! unsigned char *sout; PyObject *result; *************** *** 190,198 **** // Calculate the size for the new memory string. ! slen = strlen(sin); i = (slen * (forArray ? 7 : 4)) + 3; ! sout = (char *)PyMem_Malloc(i); // Assume every char will be quoted ! if (sout == (char *)NULL) return PyErr_NoMemory(); --- 192,200 ---- // Calculate the size for the new memory string. ! slen = strlen((char *)sin); i = (slen * (forArray ? 7 : 4)) + 3; ! sout = (unsigned char *)PyMem_Malloc(i); // Assume every char will be quoted ! if (sout == (unsigned char *)NULL) return PyErr_NoMemory(); *************** *** 318,323 **** { int i, j, slen, byte, forArray = 0; ! char *sin; ! char *sout; PyObject *result; --- 320,325 ---- { int i, j, slen, byte, forArray = 0; ! unsigned char *sin; ! unsigned char *sout; PyObject *result; *************** *** 326,334 **** // Calculate the size for the new memory string. ! slen = strlen(sin); i = (slen * (forArray ? 8 : 4)) + 3; ! sout = (char *)PyMem_Malloc(i); // Assume every char will be quoted ! if (sout == (char *)NULL) return PyErr_NoMemory(); --- 328,336 ---- // Calculate the size for the new memory string. ! slen = strlen((char *)sin); i = (slen * (forArray ? 8 : 4)) + 3; ! sout = (unsigned char *)PyMem_Malloc(i); // Assume every char will be quoted ! if (sout == (unsigned char *)NULL) return PyErr_NoMemory(); |