Merge branch 'sb/misc-fixes'
Assorted code cleanups and a minor fix. * sb/misc-fixes: diff.c: Do not initialize a variable, which gets reassigned anyway. commit: Fix a memory leak in determine_author_info daemon.c:handle: Remove unneeded check for null pointer.
This commit is contained in:
@ -534,7 +534,6 @@ static void determine_author_info(struct strbuf *author_ident)
|
|||||||
(lb - strlen(" ") -
|
(lb - strlen(" ") -
|
||||||
(a + strlen("\nauthor "))));
|
(a + strlen("\nauthor "))));
|
||||||
email = xmemdupz(lb + strlen("<"), rb - (lb + strlen("<")));
|
email = xmemdupz(lb + strlen("<"), rb - (lb + strlen("<")));
|
||||||
date = xmemdupz(rb + strlen("> "), eol - (rb + strlen("> ")));
|
|
||||||
len = eol - (rb + strlen("> "));
|
len = eol - (rb + strlen("> "));
|
||||||
date = xmalloc(len + 2);
|
date = xmalloc(len + 2);
|
||||||
*date = '@';
|
*date = '@';
|
||||||
|
2
daemon.c
2
daemon.c
@ -760,7 +760,7 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
|
|||||||
snprintf(portbuf, sizeof(portbuf), "REMOTE_PORT=%d",
|
snprintf(portbuf, sizeof(portbuf), "REMOTE_PORT=%d",
|
||||||
ntohs(sin_addr->sin_port));
|
ntohs(sin_addr->sin_port));
|
||||||
#ifndef NO_IPV6
|
#ifndef NO_IPV6
|
||||||
} else if (addr && addr->sa_family == AF_INET6) {
|
} else if (addr->sa_family == AF_INET6) {
|
||||||
struct sockaddr_in6 *sin6_addr = (void *) addr;
|
struct sockaddr_in6 *sin6_addr = (void *) addr;
|
||||||
|
|
||||||
char *buf = addrbuf + 12;
|
char *buf = addrbuf + 12;
|
||||||
|
4
diff.c
4
diff.c
@ -1683,9 +1683,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
|
|||||||
del = deleted;
|
del = deleted;
|
||||||
|
|
||||||
if (graph_width <= max_change) {
|
if (graph_width <= max_change) {
|
||||||
int total = add + del;
|
int total = scale_linear(add + del, graph_width, max_change);
|
||||||
|
|
||||||
total = scale_linear(add + del, graph_width, max_change);
|
|
||||||
if (total < 2 && add && del)
|
if (total < 2 && add && del)
|
||||||
/* width >= 2 due to the sanity check */
|
/* width >= 2 due to the sanity check */
|
||||||
total = 2;
|
total = 2;
|
||||||
|
Reference in New Issue
Block a user