ICU-4605 Return U_EOF, and not the platform dependent EOF.

X-SVN-Rev: 18080
This commit is contained in:
George Rhoten 2005-06-28 23:23:39 +00:00
parent 60a6e3e664
commit cee8cfb8c3
2 changed files with 8 additions and 2 deletions

View File

@ -283,9 +283,9 @@ u_fputc(UChar32 uc,
U16_APPEND(buf, idx, sizeof(buf)/sizeof(*buf), uc, isError);
if (isError) {
return EOF;
return U_EOF;
}
return u_file_write(buf, idx, f) == idx ? uc : EOF;
return u_file_write(buf, idx, f) == idx ? uc : U_EOF;
}

View File

@ -433,6 +433,12 @@ static void TestfgetsBuffers(void) {
}
u_fputc(0x3BC, myFile);
if (u_fputc(0x110000, myFile) != U_EOF) {
log_err("u_fputc should return U_EOF for 0x110000.\n");
}
if (u_fputc((UChar32)0xFFFFFFFFu, myFile) != U_EOF) {
log_err("u_fputc should return U_EOF for 0xFFFFFFFF.\n");
}
u_fputc(0xFF41, myFile);
u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
u_memset(expectedBuffer, 0, sizeof(expectedBuffer)/sizeof(expectedBuffer[0]));