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 8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -2763,10 +2763,14 @@ PQescapeByteaInternal(PGconn *conn,
2763
2763
{
2764
2764
if (* vp < 0x20 || * vp > 0x7e )
2765
2765
{
2766
+ int val = * vp ;
2767
+
2766
2768
if (!std_strings )
2767
2769
* 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' ;
2770
2774
}
2771
2775
else if (* vp == '\'' )
2772
2776
{
You can’t perform that action at this time.
0 commit comments