emilk / emilk/loguru

The usage of "+= snprintf" in print_preamble_header()/print_preamble() is wrong.

Open
#58 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
1.9k
Forks
280
Avg merge
7m
Merged PRs (30d)
4

Description

https://github.com/emilk/loguru/blob/bead38889d44d9fdb5c52916d1f26c4d6af09e66/loguru.hpp#L2329

Ref: http://www.cplusplus.com/reference/cstdio/snprintf/

1. The type of argument `buf_size` is `size_t`, but `out_buff_size - pos` may produce negative value.
2. The return value maybe negative if an encoding error occurs.
3. If `out_buff_size == 0`, there is no `\0`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.