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

Commitf6a05fd

Browse files
committed
Fix failure of new wchar->mb functions to advance from pointer.
Bug spotted by Tom Lane.
1 parent2eeb5eb commitf6a05fd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/backend/utils/mb/wchar.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ pg_wchar2euc_with_len(const pg_wchar *from, unsigned char *to, int len)
380380
*to++=*from;
381381
cnt++;
382382
}
383+
from++;
383384
len--;
384385
}
385386
*to=0;
@@ -518,9 +519,10 @@ pg_wchar2utf_with_len(const pg_wchar *from, unsigned char *to, int len)
518519

519520
unicode_to_utf8(*from,to);
520521
char_len=pg_utf_mblen(to);
521-
len--;
522522
cnt+=char_len;
523523
to+=char_len;
524+
from++;
525+
len--;
524526
}
525527
*to=0;
526528
returncnt;
@@ -854,6 +856,7 @@ pg_wchar2mule_with_len(const pg_wchar *from, unsigned char *to, int len)
854856
*to++=lb;
855857
cnt+=1;
856858
}
859+
from++;
857860
len--;
858861
}
859862
*to=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp