Add constness to filenames passed to functions.
[samba.git] / source3 / lib / util_str.c
index 14d50384c28070efda32bee5e4f2b48a4d5a5db5..b1d50ad9112d8f9fe0e899e933a0aab8638d4054 100644 (file)
@@ -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;
+}