projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initialize FAMs using `FLEX_ARRAY'.
[git.git]
/
http-fetch.c
diff --git
a/http-fetch.c
b/http-fetch.c
index
cc7bd1f
..
3a2cb5e
100644
(file)
--- a/
http-fetch.c
+++ b/
http-fetch.c
@@
-399,6
+399,7
@@
void prefetch(unsigned char *sha1)
snprintf(newreq->filename, sizeof(newreq->filename), "%s", filename);
snprintf(newreq->tmpfile, sizeof(newreq->tmpfile),
"%s.temp", filename);
snprintf(newreq->filename, sizeof(newreq->filename), "%s", filename);
snprintf(newreq->tmpfile, sizeof(newreq->tmpfile),
"%s.temp", filename);
+ newreq->slot = NULL;
newreq->next = NULL;
if (object_queue_head == NULL) {
newreq->next = NULL;
if (object_queue_head == NULL) {
@@
-583,10
+584,8
@@
static void process_alternates_response(void *callback_data)
// skip 'objects' at end
if (okay) {
target = xmalloc(serverlen + posn - i - 6);
// skip 'objects' at end
if (okay) {
target = xmalloc(serverlen + posn - i - 6);
- strncpy(target, base, serverlen);
- strncpy(target + serverlen, data + i,
- posn - i - 7);
- target[serverlen + posn - i - 7] = '\0';
+ safe_strncpy(target, base, serverlen);
+ safe_strncpy(target + serverlen, data + i, posn - i - 6);
if (get_verbosely)
fprintf(stderr,
"Also look at %s\n", target);
if (get_verbosely)
fprintf(stderr,
"Also look at %s\n", target);
@@
-727,8
+726,8
@@
xml_cdata(void *userData, const XML_Char *s, int len)
struct xml_ctx *ctx = (struct xml_ctx *)userData;
if (ctx->cdata)
free(ctx->cdata);
struct xml_ctx *ctx = (struct xml_ctx *)userData;
if (ctx->cdata)
free(ctx->cdata);
- ctx->cdata = x
calloc(len+1,
1);
- s
trncpy(ctx->cdata, s, len
);
+ ctx->cdata = x
malloc(len +
1);
+ s
afe_strncpy(ctx->cdata, s, len + 1
);
}
static int remote_ls(struct alt_base *repo, const char *path, int flags,
}
static int remote_ls(struct alt_base *repo, const char *path, int flags,
@@
-1137,13
+1136,14
@@
int fetch(unsigned char *sha1)
static inline int needs_quote(int ch)
{
static inline int needs_quote(int ch)
{
- switch (ch) {
- case '/': case '-': case '.':
- case 'A'...'Z': case 'a'...'z': case '0'...'9':
+ if (((ch >= 'A') && (ch <= 'Z'))
+ || ((ch >= 'a') && (ch <= 'z'))
+ || ((ch >= '0') && (ch <= '9'))
+ || (ch == '/')
+ || (ch == '-')
+ || (ch == '.'))
return 0;
return 0;
- default:
- return 1;
- }
+ return 1;
}
static inline int hex(int v)
}
static inline int hex(int v)
@@
-1271,10
+1271,10
@@
int main(int argc, char **argv)
if (pull(commit_id))
rc = 1;
if (pull(commit_id))
rc = 1;
- curl_slist_free_all(no_pragma_header);
-
http_cleanup();
http_cleanup();
+ curl_slist_free_all(no_pragma_header);
+
if (corrupt_object_found) {
fprintf(stderr,
"Some loose object were found to be corrupt, but they might be just\n"
if (corrupt_object_found) {
fprintf(stderr,
"Some loose object were found to be corrupt, but they might be just\n"