mprintf: check fputc error rather than matching returned character

OS/400 ascii fputc wrapper deviates from the posix standard by the
fact that it returns the ebcdic encoding of the original ascii
character. Testing for a matching value for success will then always
fail.

This commit replaces the chariacter comparison by an explicit error
return check.

Follow-up to ef2cf58
Closes #13367
This commit is contained in:
Patrick Monnerat 2024-04-14 14:20:28 +02:00 committed by Daniel Stenberg
parent 0469c68f49
commit 6e8a6039b8
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1160,9 +1160,7 @@ static int fputc_wrapper(unsigned char outc, void *f)
int out = outc;
FILE *s = f;
int rc = fputc(out, s);
if(rc == out)
return 0;
return 1;
return rc == EOF;
}
int curl_mprintf(const char *format, ...)