File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.196 2008/06/23 21:10:49 momjian Exp $
11+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.197 2008/09/10 17:01:07 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -2763,10 +2763,14 @@ PQescapeByteaInternal(PGconn *conn,
27632763 {
27642764 if (* vp < 0x20 || * vp > 0x7e )
27652765 {
2766+ int val = * vp ;
2767+
27662768 if (!std_strings )
27672769 * rp ++ = '\\' ;
2768- (void ) sprintf ((char * ) rp , "\\%03o" , * vp );
2769- rp += 4 ;
2770+ * rp ++ = '\\' ;
2771+ * rp ++ = (val >> 6 ) + '0' ;
2772+ * rp ++ = ((val >> 3 ) & 07 ) + '0' ;
2773+ * rp ++ = (val & 07 ) + '0' ;
27702774 }
27712775 else if (* vp == '\'' )
27722776 {
You can’t perform that action at this time.
0 commit comments