Small cache_tree_write refactor.
[gitweb.git] / convert.c
index 00a341c595ebb6ac6965001cce84d3d4e65f60c3..79c9df2e918efe16da825895708c4ac6f08bfc62 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -1,7 +1,6 @@
 #include "cache.h"
 #include "attr.h"
 #include "run-command.h"
-#include "strbuf.h"
 
 /*
  * convert.c - convert a file when checking it out and checking it in.
@@ -324,13 +323,8 @@ static int read_convert_config(const char *var, const char *value)
                if (!strncmp(drv->name, name, namelen) && !drv->name[namelen])
                        break;
        if (!drv) {
-               char *namebuf;
                drv = xcalloc(1, sizeof(struct convert_driver));
-               namebuf = xmalloc(namelen + 1);
-               memcpy(namebuf, name, namelen);
-               namebuf[namelen] = 0;
-               drv->name = namebuf;
-               drv->next = NULL;
+               drv->name = xmemdupz(name, namelen);
                *user_convert_tail = drv;
                user_convert_tail = &(drv->next);
        }