Merge branch 'rs/use-strbuf-addbuf' into maint
[gitweb.git] / builtin / gc.c
index 42258fe3481dea642e85d8eb97ff175725420121..332bcf7e7a0ae1900199349870103c388c9ffb35 100644 (file)
@@ -177,7 +177,7 @@ static int too_many_packs(void)
                 */
                cnt++;
        }
-       return gc_auto_pack_limit <= cnt;
+       return gc_auto_pack_limit < cnt;
 }
 
 static void add_repack_all_option(void)
@@ -233,7 +233,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,