From c8071c3522abefb651596e2335e724ae50cb8a90 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 17 Dec 2007 16:20:44 -0800 Subject: Use the %*s feature of snprintf to remove anothe static fstring. Jeremy. (This used to be commit 4ae4b2358688bf289305a2db0ed01b653ac073b2) --- source3/lib/util.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index 73b035b22b..11c14ea538 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2227,17 +2227,12 @@ void dump_data_pw(const char *msg, const uchar * data, size_t len) #endif } -char *tab_depth(int depth) +const char *tab_depth(int level, int depth) { - static fstring spaces; - size_t len = depth * 4; - if (len > sizeof(fstring)-1) { - len = sizeof(fstring)-1; + if( DEBUGLVL(level) ) { + dbgtext("%*s", depth*4, ""); } - - memset(spaces, ' ', len); - spaces[len] = 0; - return spaces; + return ""; } /***************************************************************************** -- cgit