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

Commitc82f76e

Browse files
committed
Fix snprintf() to properly handle precision specification for %f.
1 parenta214e9c commitc82f76e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/port/snprintf.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
* causing nasty effects.
6666
**************************************************************/
6767

68-
/*static char _id[] = "$PostgreSQL: pgsql/src/port/snprintf.c,v 1.18 2005/03/11 19:13:43 momjian Exp $";*/
68+
/*static char _id[] = "$PostgreSQL: pgsql/src/port/snprintf.c,v 1.19 2005/03/12 04:00:56 momjian Exp $";*/
6969

7070
intpg_snprintf(char*str,size_tcount,constchar*fmt,...);
7171
intpg_vsnprintf(char*str,size_tcount,constchar*fmt,va_listargs);
@@ -252,6 +252,7 @@ dopr(char *buffer, const char *format, va_list args, char *end)
252252
case'8':
253253
case'9':
254254
if (pointflag)
255+
/* could also be precision */
255256
maxwidth=maxwidth*10+ch-'0';
256257
else
257258
{
@@ -455,6 +456,7 @@ dopr(char *buffer, const char *format, va_list args, char *end)
455456
fmtpar[fmtpos].ljust=ljust;
456457
fmtpar[fmtpos].len=len;
457458
fmtpar[fmtpos].maxwidth=maxwidth;
459+
fmtpar[fmtpos].precision=position;
458460
fmtpar[fmtpos].pointflag=pointflag;
459461
fmtpar[fmtpos].func=FMTFLOAT;
460462
fmtpar[fmtpos].realpos=realpos?realpos:fmtpos;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp