Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -97,8 +97,7 @@ void logString(FILE *logfile, const char *msg, ...) {
va_start(argprt, msg);
vsnprintf(tmpbuf, sizeof(tmpbuf), msg, argprt);

fprintf(logfile, tmpbuf);
fprintf(logfile, "\n");
fputs(tmpbuf, logfile);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since fputs doesn't add a line break automatically, you have to add it explicitly.

    fputs(tmpbuf, logfile);
    fputs("\n", logfile);

Copy link
Contributor Author

@DamonGuy DamonGuy Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this too!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless I'm missing something you'd need to add a 2nd fputs for the newline or go back to fprintf like before the latest comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have gone back to fprintf for consistency as you mentioned above. Newline is included. Thanks!

fflush(logfile);
}

Expand Down