mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-66 Don't write 0 or fewer bytes with fwrite()
X-SVN-Rev: 3653
This commit is contained in:
parent
e8546eb6e1
commit
32466038a2
1 changed files with 6 additions and 2 deletions
|
@ -841,14 +841,18 @@ void IntlTest::LL_message( UnicodeString message, UBool newline )
|
|||
|
||||
// stream out the indentation string first if necessary
|
||||
length = indent.extract(1, indent.length(), buffer, sizeof(buffer));
|
||||
fwrite(buffer, sizeof(*buffer), length, testoutfp);
|
||||
if (length > 0) {
|
||||
fwrite(buffer, sizeof(*buffer), length, testoutfp);
|
||||
}
|
||||
|
||||
// replace each LineFeed by the indentation string
|
||||
message.findAndReplace(UnicodeString((UChar)'\n'), indent);
|
||||
|
||||
// stream out the message
|
||||
length = message.extract(0, message.length(), buffer, sizeof(buffer));
|
||||
fwrite(buffer, sizeof(*buffer), length, testoutfp);
|
||||
if (length > 0) {
|
||||
fwrite(buffer, sizeof(*buffer), length, testoutfp);
|
||||
}
|
||||
|
||||
if (newline) {
|
||||
char newLine = '\n';
|
||||
|
|
Loading…
Add table
Reference in a new issue