mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-26 21:58:08 +01:00
Fix off-by-one bug in log functions
This commit is contained in:
parent
d3f3619c3a
commit
a1bb58017b
1 changed files with 2 additions and 2 deletions
|
@ -68,7 +68,7 @@ void _sway_log(log_importance_t verbosity, const char* format, ...) {
|
|||
#endif
|
||||
if (verbosity <= v) {
|
||||
unsigned int c = verbosity;
|
||||
if (c > sizeof(verbosity_colors) / sizeof(char *)) {
|
||||
if (c > sizeof(verbosity_colors) / sizeof(char *) - 1) {
|
||||
c = sizeof(verbosity_colors) / sizeof(char *) - 1;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ void _sway_log(log_importance_t verbosity, const char* format, ...) {
|
|||
void sway_log_errno(log_importance_t verbosity, char* format, ...) {
|
||||
if (verbosity <= v) {
|
||||
unsigned int c = verbosity;
|
||||
if (c > sizeof(verbosity_colors) / sizeof(char *)) {
|
||||
if (c > sizeof(verbosity_colors) / sizeof(char *) - 1) {
|
||||
c = sizeof(verbosity_colors) / sizeof(char *) - 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue