1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

debug: Remove FORMAT_BUFR_MAX, use FORMAT_BUFR_SIZE - 1 instead

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Christof Schmitt 2015-03-20 14:19:09 -07:00
parent 0509790ec3
commit ba86450b27

View File

@ -37,14 +37,13 @@
/* -------------------------------------------------------------------------- **
* Defines...
*
* FORMAT_BUFR_MAX - Index of the last byte of the format buffer;
* format_bufr[FORMAT_BUFR_MAX] should always be reserved
* for a terminating null byte.
*/
/*
* format_bufr[FORMAT_BUFR_SIZE - 1] should always be reserved
* for a terminating null byte.
*/
#define FORMAT_BUFR_SIZE 1024
#define FORMAT_BUFR_MAX (FORMAT_BUFR_SIZE - 1)
/* -------------------------------------------------------------------------- **
* This module implements Samba's debugging utility.
@ -889,7 +888,7 @@ static void format_debug_text( const char *msg )
}
/* If there's room, copy the character to the format buffer. */
if( format_pos < FORMAT_BUFR_MAX )
if (format_pos < FORMAT_BUFR_SIZE - 1)
format_bufr[format_pos++] = msg[i];
/* If a newline is encountered, print & restart. */
@ -899,7 +898,7 @@ static void format_debug_text( const char *msg )
/* If the buffer is full dump it out, reset it, and put out a line
* continuation indicator.
*/
if( format_pos >= FORMAT_BUFR_MAX ) {
if (format_pos >= FORMAT_BUFR_SIZE - 1) {
bufr_print();
(void)Debug1( " +>\n" );
}