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

Commit2b714fd

Browse files
committed
Fix for usage of spirntf in more portable way.
1 parent9f8ff2a commit2b714fd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.45 2001/11/19 09:05:01 tgl Exp $
4+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.46 2001/12/05 02:06:19 ishii Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2000, PostgreSQL Global Development Group
@@ -4140,7 +4140,10 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout, char *number,
41404140
Np->inout_p+=strlen(Np->inout_p)-1;
41414141
}
41424142
else
4143-
Np->inout_p+=sprintf(Np->inout_p,"%15s",Np->number_p)-1;
4143+
{
4144+
sprintf(Np->inout_p,"%15s",Np->number_p);
4145+
Np->inout_p+=strlen(Np->inout_p)-1;
4146+
}
41444147
break;
41454148

41464149
caseNUM_rn:
@@ -4150,7 +4153,10 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout, char *number,
41504153
Np->inout_p+=strlen(Np->inout_p)-1;
41514154
}
41524155
else
4153-
Np->inout_p+=sprintf(Np->inout_p,"%15s",str_tolower(Np->number_p))-1;
4156+
{
4157+
sprintf(Np->inout_p,"%15s",str_tolower(Np->number_p));
4158+
Np->inout_p+=strlen(Np->inout_p)-1;
4159+
}
41544160
break;
41554161

41564162
caseNUM_th:
@@ -4664,7 +4670,8 @@ float4_to_char(PG_FUNCTION_ARGS)
46644670
}
46654671

46664672
orgnum= (char*)palloc(MAXFLOATWIDTH+1);
4667-
len=sprintf(orgnum,"%.0f",fabs(val));
4673+
sprintf(orgnum,"%.0f",fabs(val));
4674+
len=strlen(orgnum);
46684675
if (Num.pre>len)
46694676
plen=Num.pre-len;
46704677
if (len >=FLT_DIG)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp