Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4ca28eb

Browse files
committed
I just discovered, that there is missing a const when passing a buffer
to PQescapeBytea and PQunescapeBytea. I fixed it and tried to create ausable diff (I'm not so familar to diff).Tommi M?kitalo
1 parent3eabc44 commit4ca28eb

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

‎doc/src/sgml/libpq.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.99 2002/11/08 05:03:11 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.100 2002/11/10 00:14:22 momjian Exp $
33
-->
44

55
<chapter id="libpq">
@@ -926,7 +926,7 @@ strings overlap.
926926
<function>PQescapeBytea</function>
927927
Escapes a binary string (<type>bytea</type> type) for use within an SQL query.
928928
<synopsis>
929-
unsigned char *PQescapeBytea(unsigned char *from,
929+
unsigned char *PQescapeBytea(constunsigned char *from,
930930
size_t from_length,
931931
size_t *to_length);
932932
</synopsis>
@@ -970,7 +970,7 @@ strings overlap.
970970
Converts an escaped string representation of binary data into binary
971971
data - the reverse of <function>PQescapeBytea</function>.
972972
<synopsis>
973-
unsigned char *PQunescapeBytea(unsigned char *from, size_t *to_length);
973+
unsigned char *PQunescapeBytea(constunsigned char *from, size_t *to_length);
974974
</synopsis>
975975

976976
The <parameter>from</parameter> parameter points to an escaped string

‎src/interfaces/libpq/fe-exec.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.122 2002/09/04 20:31:47 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.123 2002/11/10 00:14:22 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -118,9 +118,9 @@ PQescapeString(char *to, const char *from, size_t length)
118118
*anything >= 0x80 ---> \\ooo (where ooo is an octal expression)
119119
*/
120120
unsignedchar*
121-
PQescapeBytea(unsignedchar*bintext,size_tbinlen,size_t*bytealen)
121+
PQescapeBytea(constunsignedchar*bintext,size_tbinlen,size_t*bytealen)
122122
{
123-
unsignedchar*vp;
123+
constunsignedchar*vp;
124124
unsignedchar*rp;
125125
unsignedchar*result;
126126
size_ti;
@@ -202,12 +202,12 @@ PQescapeBytea(unsigned char *bintext, size_t binlen, size_t *bytealen)
202202
*6\\
203203
*/
204204
unsignedchar*
205-
PQunescapeBytea(unsignedchar*strtext,size_t*retbuflen)
205+
PQunescapeBytea(constunsignedchar*strtext,size_t*retbuflen)
206206
{
207207
size_tbuflen;
208208
unsignedchar*buffer,
209-
*sp,
210209
*bp;
210+
constunsignedchar*sp;
211211
unsignedintstate=0;
212212

213213
if (strtext==NULL)

‎src/interfaces/libpq/libpq-fe.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: libpq-fe.h,v 1.86 2002/09/04 20:31:47 momjian Exp $
10+
* $Id: libpq-fe.h,v 1.87 2002/11/10 00:14:22 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -249,9 +249,9 @@ extern PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn,
249249

250250
/* Quoting strings before inclusion in queries. */
251251
externsize_tPQescapeString(char*to,constchar*from,size_tlength);
252-
externunsignedchar*PQescapeBytea(unsignedchar*bintext,size_tbinlen,
252+
externunsignedchar*PQescapeBytea(constunsignedchar*bintext,size_tbinlen,
253253
size_t*bytealen);
254-
externunsignedchar*PQunescapeBytea(unsignedchar*strtext,
254+
externunsignedchar*PQunescapeBytea(constunsignedchar*strtext,
255255
size_t*retbuflen);
256256

257257

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp