| 942 | /* acl_vstring_sprintf_prepend - format + prepend string, vsprintf-like interface */ |
| 943 | |
| 944 | ACL_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 | |
| 967 | const ACL_VSTRING *acl_buffer_gets_nonl(ACL_VSTRING *vp, const char **src, size_t dlen) |
| 968 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…