otrv4 / libotr-ng

A new implementation of OTR with support for version 4. This is a mirror of https://bugs.otr.im/otrv4/libotr-ng
Other
43 stars 9 forks source link

Fix error reported by clang-tidy and MAC OS machine #165

Closed claucece closed 5 years ago

claucece commented 5 years ago

Clang-tidy reports:

/home/travis/build/otrv4/libotr-ng/src/debug.c:98:11: warning: Function 'vfprintf' is called with an uninitialized va_list argument [clang-analyzer-valist.Uninitialized]
    (void)vfprintf(f, fmt, args);
          ^
/home/travis/build/otrv4/libotr-ng/src/debug.c:90:7: note: Assuming 'debug_printing_enabled' is not equal to 0
  if (debug_printing_enabled) {
      ^
/home/travis/build/otrv4/libotr-ng/src/debug.c:90:3: note: Taking true branch
  if (debug_printing_enabled) {
  ^
/home/travis/build/otrv4/libotr-ng/src/debug.c:91:18: note: Assuming 'ix' is >= 'debug_indent'
    for (ix = 0; ix < debug_indent; ix++) {
                 ^
/home/travis/build/otrv4/libotr-ng/src/debug.c:91:5: note: Loop condition is false. Execution continues on line 95
    for (ix = 0; ix < debug_indent; ix++) {
    ^
/home/travis/build/otrv4/libotr-ng/src/debug.c:98:11: note: Function 'vfprintf' is called with an uninitialized va_list argument
    (void)vfprintf(f, fmt, args);

See that on the 'style' machine