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

Commitb178865

Browse files
committed
cash_words_out function truncated its output by 1 character due to
incorrect use of StrNCpy.
1 parent58422dd commitb178865

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* workings can be found in the book "Software Solutions in C" by
1010
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
1111
*
12-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.33 2000/01/15 02:59:36 petere Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.34 2000/03/19 22:10:52 tgl Exp $
1313
*/
1414

1515
#include<limits.h>
@@ -723,7 +723,7 @@ cash_words_out(Cash *value)
723723
/* make a text type for output */
724724
result= (text*)palloc(strlen(buf)+VARHDRSZ);
725725
VARSIZE(result)=strlen(buf)+VARHDRSZ;
726-
StrNCpy(VARDATA(result),buf,strlen(buf));
726+
memcpy(VARDATA(result),buf,strlen(buf));
727727

728728
returnresult;
729729
}/* cash_words_out() */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp