Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use a clearer condition in utilities::logger::append_newline
Credits to @brixen, follow-up on 0b4b712.

[ci skip]
  • Loading branch information
ahmadsherif committed Feb 24, 2016
1 parent 0b4b712 commit 99579cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vm/util/logger.cpp
Expand Up @@ -54,7 +54,7 @@ namespace rubinius {
char* end = (char*)memchr(message, '\0', LOGGER_MSG_SIZE);
size_t bytes = end ? end - message : LOGGER_MSG_SIZE;

if(LOGGER_MSG_SIZE - bytes > 1) {
if(bytes + 1 < LOGGER_MSG_SIZE) {
if(message[bytes-1] != '\n') {
message[bytes] = '\n';
message[bytes += 1] = '\0';
Expand Down

0 comments on commit 99579cb

Please sign in to comment.