We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c221c3 commit bacf7b2Copy full SHA for bacf7b2
src/interfaces/libpq/fe-exec.c
@@ -8,7 +8,7 @@
8
*
9
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.196 2008/06/23 21:10:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.197 2008/09/10 17:01:07 tgl Exp $
12
13
*-------------------------------------------------------------------------
14
*/
@@ -2763,10 +2763,14 @@ PQescapeByteaInternal(PGconn *conn,
2763
{
2764
if (*vp < 0x20 || *vp > 0x7e)
2765
2766
+ int val = *vp;
2767
+
2768
if (!std_strings)
2769
*rp++ = '\\';
- (void) sprintf((char *) rp, "\\%03o", *vp);
- rp += 4;
2770
+ *rp++ = '\\';
2771
+ *rp++ = (val >> 6) + '0';
2772
+ *rp++ = ((val >> 3) & 07) + '0';
2773
+ *rp++ = (val & 07) + '0';
2774
}
2775
else if (*vp == '\'')
2776
0 commit comments