git wrapper: add --git-dir=<path> and --bare options
[gitweb.git] / http-fetch.c
index 2b63d89501cc8838cca96506b3532d33fc452a15..12493fbed2822ce41b5b4c23fb85d6f4a47c104a 100644 (file)
@@ -490,7 +490,7 @@ static int setup_index(struct alt_base *repo, unsigned char *sha1)
 {
        struct packed_git *new_pack;
        if (has_pack_file(sha1))
-               return 0; // don't list this as something we can get
+               return 0; /* don't list this as something we can get */
 
        if (fetch_index(repo, sha1))
                return -1;
@@ -570,7 +570,7 @@ static void process_alternates_response(void *callback_data)
                                                 base[serverlen - 1] != '/');
                                        i += 3;
                                }
-                               // If the server got removed, give up.
+                               /* If the server got removed, give up. */
                                okay = strchr(base, ':') - base + 3 <
                                        serverlen;
                        } else if (alt_req->http_specific) {
@@ -581,11 +581,11 @@ static void process_alternates_response(void *callback_data)
                                        okay = 1;
                                }
                        }
-                       // skip 'objects' at end
+                       /* skip 'objects' at end */
                        if (okay) {
                                target = xmalloc(serverlen + posn - i - 6);
-                               safe_strncpy(target, base, serverlen);
-                               safe_strncpy(target + serverlen, data + i, posn - i - 6);
+                               strlcpy(target, base, serverlen);
+                               strlcpy(target + serverlen, data + i, posn - i - 6);
                                if (get_verbosely)
                                        fprintf(stderr,
                                                "Also look at %s\n", target);
@@ -727,7 +727,7 @@ xml_cdata(void *userData, const XML_Char *s, int len)
        if (ctx->cdata)
                free(ctx->cdata);
        ctx->cdata = xmalloc(len + 1);
-       safe_strncpy(ctx->cdata, s, len + 1);
+       strlcpy(ctx->cdata, s, len + 1);
 }
 
 static int remote_ls(struct alt_base *repo, const char *path, int flags,