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

Commit8d320b6

Browse files
committed
Code review of strftime patch, per comments from Tom:
* Use correct buffer size MAX_L10N_DATA* Use strlcpy instead of StrNCpy
1 parentf8e5b79 commit8d320b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/utils/adt/pg_locale.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 2002-2009, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.44 2009/01/0913:03:55 mha Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.45 2009/01/0914:07:00 mha Exp $
88
*
99
*-----------------------------------------------------------------------
1010
*/
@@ -476,7 +476,7 @@ strftime_win32(char *dst, size_t dstlen, const wchar_t *format, const struct tm
476476

477477
encoding=GetDatabaseEncoding();
478478

479-
len=wcsftime(wbuf,sizeof(wbuf),format,tm);
479+
len=wcsftime(wbuf,MAX_L10N_DATA,format,tm);
480480
if (len==0)
481481
/* strftime call failed - return 0 with the contents of dst unspecified */
482482
return0;
@@ -492,7 +492,7 @@ strftime_win32(char *dst, size_t dstlen, const wchar_t *format, const struct tm
492492
char*convstr=pg_do_encoding_conversion(dst,len,PG_UTF8,encoding);
493493
if (dst!=convstr)
494494
{
495-
StrNCpy(dst,convstr,dstlen);
495+
strlcpy(dst,convstr,dstlen);
496496
len=strlen(dst);
497497
}
498498
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp