]> git.ipfire.org Git - thirdparty/git.git/blobdiff - strbuf.c
Replace all die("BUG: ...") calls by BUG() ones
[thirdparty/git.git] / strbuf.c
index 83d05024e6718f4b9481e1782ed84117d5e7598a..2954622c10326c61febab4aa035e8f0a964c836d 100644 (file)
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,6 +1,5 @@
 #include "cache.h"
 #include "refs.h"
-#include "string-list.h"
 #include "utf8.h"
 
 int starts_with(const char *str, const char *prefix)
@@ -172,21 +171,6 @@ struct strbuf **strbuf_split_buf(const char *str, size_t slen,
        return ret;
 }
 
-void strbuf_add_separated_string_list(struct strbuf *str,
-                                     const char *sep,
-                                     struct string_list *slist)
-{
-       struct string_list_item *item;
-       int sep_needed = 0;
-
-       for_each_string_list_item(item, slist) {
-               if (sep_needed)
-                       strbuf_addstr(str, sep);
-               strbuf_addstr(str, item->string);
-               sep_needed = 1;
-       }
-}
-
 void strbuf_list_free(struct strbuf **sbs)
 {
        struct strbuf **s = sbs;
@@ -325,12 +309,12 @@ void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap)
        len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, cp);
        va_end(cp);
        if (len < 0)
-               die("BUG: your vsnprintf is broken (returned %d)", len);
+               BUG("your vsnprintf is broken (returned %d)", len);
        if (len > strbuf_avail(sb)) {
                strbuf_grow(sb, len);
                len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
                if (len > strbuf_avail(sb))
-                       die("BUG: your vsnprintf is broken (insatiable)");
+                       BUG("your vsnprintf is broken (insatiable)");
        }
        strbuf_setlen(sb, sb->len + len);
 }