Skip to content

Commit 604b2b7

Browse files
committed
Fix snprintf.c for SDK71 support
1 parent 8b83f2f commit 604b2b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/port/snprintf.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,14 +1169,15 @@ trailing_pad(int *padlen, PrintfTarget *target)
11691169
int pg_fputs(const char *s, FILE *stream)
11701170
{
11711171
PrintfTarget target;
1172+
11721173
if (stream == NULL)
11731174
{
11741175
errno = EINVAL;
11751176
return -1;
11761177
}
11771178
target.bufstart = s;
11781179
target.nchars = 0;
1179-
target.bufptr= s+strlen(s);
1180+
target.bufptr= s + strlen(s);
11801181
target.bufend=NULL;
11811182
target.failed=false;
11821183
target.stream = stream;
@@ -1187,11 +1188,11 @@ int pg_fputs(const char *s, FILE *stream)
11871188
/* replacement to puts function which uses flushBuffer */
11881189
int pg_puts(const char *tmps)
11891190
{
1191+
PrintfTarget target;
11901192
char *s = NULL;
11911193

11921194
s = (char *)malloc(strlen(tmps) + 1);
11931195
sprintf(s, "%s\n", tmps);
1194-
PrintfTarget target;
11951196
target.bufstart = s;
11961197
target.nchars = 0;
11971198
target.bufptr = s + strlen(s);

0 commit comments

Comments
 (0)