uschar *
string_format_size(int size, uschar *buffer)
{
-if (size == 0) Ustrcpy(CS buffer, " ");
+if (size == 0) Ustrcpy(buffer, " ");
else if (size < 1024) sprintf(CS buffer, "%5d", size);
else if (size < 10*1024)
sprintf(CS buffer, "%4.1fK", (double)size / 1024.0);
/* Get a new block of store guaranteed big enough to hold the
expanded string. */
-ss = store_get(length + nonprintcount * 4 + 1);
+ss = store_get(length + nonprintcount * 3 + 1);
/* Copy everying, escaping non printers. */
*/
uschar *
-string_copylc(uschar *s)
+string_copylc(const uschar *s)
{
uschar *ss = store_get(Ustrlen(s) + 1);
uschar *p = ss;
*/
uschar *
-string_copyn(uschar *s, int n)
+string_copyn(const uschar *s, int n)
{
uschar *ss = store_get(n + 1);
Ustrncpy(ss, s, n);
va_start(ap, format);
if (!string_vformat(buffer, sizeof(buffer), format, ap))
log_write(0, LOG_MAIN|LOG_PANIC_DIE,
- "string_sprintf expansion was longer than " SIZE_T_FMT, sizeof(buffer));
+ "string_sprintf expansion was longer than " SIZE_T_FMT " (%s)",
+ sizeof(buffer), format);
va_end(ap);
return string_copy(buffer);
}
new = string_cat(new, &sz, &off, &sep, 1);
}
-while (sp = Ustrchr(ele, sep))
+while((sp = Ustrchr(ele, sep)))
{
new = string_cat(new, &sz, &off, ele, sp-ele+1);
new = string_cat(new, &sz, &off, &sep, 1);