MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_vstring_sprintf_prepend

Function acl_vstring_sprintf_prepend

lib_acl/src/stdlib/acl_vstring.c:944–965  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

942/* acl_vstring_sprintf_prepend - format + prepend string, vsprintf-like interface */
943
944ACL_VSTRING *acl_vstring_sprintf_prepend(ACL_VSTRING *vp, const char *format,...)
945{
946 va_list ap;
947 ssize_t old_len = (ssize_t) ACL_VSTRING_LEN(vp);
948 ssize_t result_len;
949
950 /* Construct: old|new|free */
951 va_start(ap, format);
952 vp = acl_vstring_vsprintf_append(vp, format, ap);
953 va_end(ap);
954 result_len = (ssize_t) ACL_VSTRING_LEN(vp);
955
956 /* Construct: old|new|old|free */
957 ACL_VSTRING_SPACE(vp, old_len); /* avoid dangling pointer */
958 acl_vstring_memcat(vp, acl_vstring_str(vp), old_len);
959
960 /* Construct: new|old|free */
961 memmove(acl_vstring_str(vp), acl_vstring_str(vp) + old_len, result_len);
962 ACL_VSTRING_AT_OFFSET(vp, result_len);
963 ACL_VSTRING_TERMINATE(vp);
964 return vp;
965}
966
967const ACL_VSTRING *acl_buffer_gets_nonl(ACL_VSTRING *vp, const char **src, size_t dlen)
968{

Callers

nothing calls this directly

Calls 2

acl_vstring_memcatFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…