@@ -249,42 +249,6 @@ void strbuf_insert(struct strbuf *sb, size_t pos, const void *data, size_t len)
249
249
strbuf_splice (sb , pos , 0 , data , len );
250
250
}
251
251
252
- void strbuf_vinsertf (struct strbuf * sb , size_t pos , const char * fmt , va_list ap )
253
- {
254
- int len , len2 ;
255
- char save ;
256
- va_list cp ;
257
-
258
- if (pos > sb -> len )
259
- die ("`pos' is too far after the end of the buffer" );
260
- va_copy (cp , ap );
261
- len = vsnprintf (sb -> buf + sb -> len , 0 , fmt , cp );
262
- va_end (cp );
263
- if (len < 0 )
264
- BUG ("your vsnprintf is broken (returned %d)" , len );
265
- if (!len )
266
- return ; /* nothing to do */
267
- if (unsigned_add_overflows (sb -> len , len ))
268
- die ("you want to use way too much memory" );
269
- strbuf_grow (sb , len );
270
- memmove (sb -> buf + pos + len , sb -> buf + pos , sb -> len - pos );
271
- /* vsnprintf() will append a NUL, overwriting one of our characters */
272
- save = sb -> buf [pos + len ];
273
- len2 = vsnprintf (sb -> buf + pos , sb -> alloc - sb -> len , fmt , ap );
274
- sb -> buf [pos + len ] = save ;
275
- if (len2 != len )
276
- BUG ("your vsnprintf is broken (returns inconsistent lengths)" );
277
- strbuf_setlen (sb , sb -> len + len );
278
- }
279
-
280
- void strbuf_insertf (struct strbuf * sb , size_t pos , const char * fmt , ...)
281
- {
282
- va_list ap ;
283
- va_start (ap , fmt );
284
- strbuf_vinsertf (sb , pos , fmt , ap );
285
- va_end (ap );
286
- }
287
-
288
252
void strbuf_remove (struct strbuf * sb , size_t pos , size_t len )
289
253
{
290
254
strbuf_splice (sb , pos , len , "" , 0 );
0 commit comments