diff --git a/loguru.cpp b/loguru.cpp index f69dd61..8ded665 100644 --- a/loguru.cpp +++ b/loguru.cpp @@ -1284,7 +1284,14 @@ namespace loguru } } if (g_preamble_pipe && pos < out_buff_size) { - /* pos += */ (void)snprintf(out_buff + pos, out_buff_size - pos, "| "); + (void)snprintf(out_buff + pos, out_buff_size - pos, "| "); + + // Because this is the last if-statement, we avoid incrementing the + // position to clarify it's unused. If more cases are added, then: + // int bytes = snprintf(...) + // if (bytes > 0) { + // pos += bytes; + // } } } @@ -1363,7 +1370,13 @@ namespace loguru } } if (g_preamble_pipe && pos < out_buff_size) { - /* pos += */ (void)snprintf(out_buff + pos, out_buff_size - pos, "| "); + (void)snprintf(out_buff + pos, out_buff_size - pos, "| "); + + // Avoid incrementing the position to clarify it's unused + // int bytes = snprintf(...) + // if (bytes > 0) { + // pos += bytes; + // } } }