Skip to content

Commit 5b1b3ef

Browse files
committed
Adjust mbutils.c so it won't get broken by future pgindent runs.
To do that, replace L'\0' by (WCHAR) 0. Perhaps someday we should teach pgindent about wide-character literals, but so long as this is the only use-case in the entire Postgres sources, a workaround seems easier.
1 parent e324348 commit 5b1b3ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/utils/mb/mbutils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Tatsuo Ishii
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.97 2010/07/06 21:09:00 tgl Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.98 2010/07/07 15:13:21 tgl Exp $
88
*/
99
#include "postgres.h"
1010

@@ -1016,7 +1016,7 @@ pgwin32_toUTF16(const char *str, int len, int *utf16len)
10161016
{
10171017
utf16 = (WCHAR *) palloc(sizeof(WCHAR) * (len + 1));
10181018
dstlen = MultiByteToWideChar(codepage, 0, str, len, utf16, len);
1019-
utf16[dstlen] = L'\0';
1019+
utf16[dstlen] = (WCHAR) 0;
10201020
}
10211021
else
10221022
{
@@ -1029,7 +1029,7 @@ pgwin32_toUTF16(const char *str, int len, int *utf16len)
10291029

10301030
utf16 = (WCHAR *) palloc(sizeof(WCHAR) * (len + 1));
10311031
dstlen = MultiByteToWideChar(CP_UTF8, 0, utf8, len, utf16, len);
1032-
utf16[dstlen] = L'\0';
1032+
utf16[dstlen] = (WCHAR) 0;
10331033

10341034
if (utf8 != str)
10351035
pfree(utf8);

0 commit comments

Comments
 (0)