Skip to content

Commit 9a74837

Browse files
committed
Work around bug in strxfmt() but in MS VS2005.
William ZHANG
1 parent cd2a6b5 commit 9a74837

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/backend/utils/adt/selfuncs.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.210 2006/07/24 01:19:48 tgl Exp $
18+
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.211 2006/07/26 17:17:28 momjian Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -2956,7 +2956,15 @@ convert_string_datum(Datum value, Oid typid)
29562956
* == as you'd expect. Can't any of these people program their way
29572957
* out of a paper bag?
29582958
*/
2959-
xfrmlen = strxfrm(NULL, val, 0);
2959+
#if _MSC_VER == 1400 /* VS.Net 2005 */
2960+
/* http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99694 */
2961+
{
2962+
char x[1];
2963+
xfrmlen = strxfrm(x, val, 0);
2964+
}
2965+
#else
2966+
xfrmlen = strxfrm(NULL, val, 0);
2967+
#endif
29602968
xfrmstr = (char *) palloc(xfrmlen + 1);
29612969
xfrmlen2 = strxfrm(xfrmstr, val, xfrmlen + 1);
29622970
Assert(xfrmlen2 <= xfrmlen);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy