X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib%2Fdebug.c;h=5136175a1b7c9081f8cfeebd83fe1baea0919503;hp=ddf6284c4ee7163cf7f55fe35266b1c7021fb423;hb=6a0fbdc73204a837ec7d378eaf0e1248a982ba9d;hpb=814a01519c9605d479201b99eb16c97b0ad8635d diff --git a/lib/debug.c b/lib/debug.c index ddf6284..5136175 100644 --- a/lib/debug.c +++ b/lib/debug.c @@ -35,7 +35,8 @@ void debug_start (const char* basedir) { char buf[_POSIX_PATH_MAX]; char buf2[_POSIX_PATH_MAX]; - if (DebugLevel < 0 || !basedir || !*basedir) + if (DebugLevel < DEBUG_MIN_LEVEL || DebugLevel > DEBUG_MAX_LEVEL + || !basedir || !*basedir) return; /* rotate the old debug logs */ for (i = 3; i >= 0; i--) { @@ -53,7 +54,7 @@ void debug_start (const char* basedir) { } void _debug_print_intro (const char* file, int line, const char* function, int level) { - if (!DebugFile || DebugLevel < 0) + if (!DebugFile || DebugLevel < DEBUG_MIN_LEVEL || DebugLevel > DEBUG_MAX_LEVEL) return; fprintf (DebugFile, "[%d:%s:%d", level, NONULL(file), line); if (function && *function)