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

Commit747e19a

Browse files
committed
Add in, I think, support for %lld in snprintf(), specifically withIrix in mind...
1 parent3ce8a1b commit747e19a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎src/backend/port/snprintf.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
* causing nast effects.
7171
**************************************************************/
7272

73-
/*static char _id[] = "$Id: snprintf.c,v 1.6 1998/09/18 05:20:22 momjian Exp $";*/
73+
/*static char _id[] = "$Id: snprintf.c,v 1.7 1998/09/23 03:11:24 scrappy Exp $";*/
7474
staticchar*end;
7575
staticintSnprfOverflow;
7676

@@ -126,6 +126,7 @@ dopr (char *buffer, const char *format, ... )
126126
intch;
127127
longvalue;
128128
intlongflag=0;
129+
intlonglongflag=0;
129130
intpointflag=0;
130131
intmaxwidth=0;
131132
char*strvalue;
@@ -167,7 +168,11 @@ dopr (char *buffer, const char *format, ... )
167168
len=va_arg(args,int );
168169
gotonextch;
169170
case'.':pointflag=1; gotonextch;
170-
case'l':longflag=1; gotonextch;
171+
case'l':if(longflag) {
172+
longlongflag=1; gotonextch;
173+
}else {
174+
longflag=1; gotonextch;
175+
}
171176
case'u':case'U':
172177
/*fmtnum(value,base,dosign,ljust,len,zpad) */
173178
if(longflag ){
@@ -186,7 +191,11 @@ dopr (char *buffer, const char *format, ... )
186191
fmtnum(value,8,0,ljust,len,zpad );break;
187192
case'd':case'D':
188193
if(longflag ){
194+
if(longlongflag ) {
195+
value=va_arg(args,longlong );
196+
}else {
189197
value=va_arg(args,long );
198+
}
190199
}else {
191200
value=va_arg(args,int );
192201
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp