2
2
* Exim - an Internet mail transport agent *
3
3
*************************************************/
5
/* Copyright (c) University of Cambridge 1995 - 2012 */
5
/* Copyright (c) University of Cambridge 1995 - 2014 */
6
6
/* See the file NOTICE for conditions of use and distribution. */
8
8
/* Miscellaneous string-handling functions. Some are not required for
304
304
/* Get a new block of store guaranteed big enough to hold the
305
305
expanded string. */
307
ss = store_get(length + nonprintcount * 4 + 1);
307
ss = store_get(length + nonprintcount * 3 + 1);
309
309
/* Copy everying, escaping non printers. */
716
717
va_start(ap, format);
717
718
if (!string_vformat(buffer, sizeof(buffer), format, ap))
718
719
log_write(0, LOG_MAIN|LOG_PANIC_DIE,
719
"string_sprintf expansion was longer than " SIZE_T_FMT, sizeof(buffer));
720
"string_sprintf expansion was longer than " SIZE_T_FMT " (%s)",
721
sizeof(buffer), format);
721
723
return string_copy(buffer);
965
967
#endif /* COMPILE_UTILITY */
970
#ifndef COMPILE_UTILITY
971
/************************************************
972
* Add element to seperated list *
973
************************************************/
974
/* This function is used to build a list, returning
975
an allocated null-terminated growable string. The
976
given element has any embedded seperator characters
980
list points to the start of the list that is being built, or NULL
981
if this is a new list that has no contents yet
982
sep list seperator charactoer
983
ele new lement to be appended to the list
985
Returns: pointer to the start of the list, changed if copied for expansion.
989
string_append_listele(uschar * list, uschar sep, const uschar * ele)
997
new = string_cat(new, &sz, &off, list, Ustrlen(list));
998
new = string_cat(new, &sz, &off, &sep, 1);
1001
while((sp = Ustrchr(ele, sep)))
1003
new = string_cat(new, &sz, &off, ele, sp-ele+1);
1004
new = string_cat(new, &sz, &off, &sep, 1);
1007
new = string_cat(new, &sz, &off, ele, Ustrlen(ele));
1011
#endif /* COMPILE_UTILITY */
969
1015
#ifndef COMPILE_UTILITY
970
1016
/*************************************************