Merge branch 'js/cvs'
[gitweb.git] / http-fetch.c
index 2b63d89501cc8838cca96506b3532d33fc452a15..dc286b79f614a1e2c9ef2c21c2cc198bab973843 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,
@@ -1245,7 +1245,7 @@ int main(int argc, char **argv)
                arg++;
        }
        if (argc < arg + 2) {
-               usage("git-http-fetch [-c] [-t] [-a] [-d] [-v] [--recover] [-w ref] commit-id url");
+               usage("git-http-fetch [-c] [-t] [-a] [-v] [--recover] [-w ref] commit-id url");
                return 1;
        }
        commit_id = argv[arg];