initdb: make safe_create_dir public
[gitweb.git] / builtin / gc.c
index cb13ab72c3cce47ac0b91f2ae7c0f03395ba5b46..df3e454447ea4e4e34c6a7eac7ef54df1d614df6 100644 (file)
@@ -217,7 +217,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
                return NULL;
 
        if (gethostname(my_host, sizeof(my_host)))
-               strcpy(my_host, "unknown");
+               xsnprintf(my_host, sizeof(my_host), "unknown");
 
        pidfile_path = git_pathdup("gc.pid");
        fd = hold_lock_file_for_update(&lock, pidfile_path,