From df3d5b3556146e2d60c1a5656b16236f96832a16 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 15 Jan 2002 01:37:12 +0000 Subject: Add constness to filenames passed to functions. (This used to be commit 8d106dc1f4a51112516d72ae68747ca6b5b904b7) --- source3/lib/util_str.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3/lib/util_str.c') diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 14d50384c2..b1d50ad911 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -937,3 +937,28 @@ char *binary_string(char *buf, int len) return s; } + +/* Just a typesafety wrapper for snprintf into a pstring */ +int pstr_sprintf(pstring s, const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret = vsnprintf(PSTR_MUTABLE(s), PSTRING_LEN, fmt, ap); + va_end(ap); + return ret; +} + + +/* Just a typesafety wrapper for snprintf into a pstring */ +int fstr_sprintf(fstring s, const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret = vsnprintf(FSTR_MUTABLE(s), FSTRING_LEN, fmt, ap); + va_end(ap); + return ret; +} -- cgit