Fix some more Xcode8 warnings & analyze warnings.

This commit is contained in:
Alexei Svitkine
2016-12-17 22:24:00 -05:00
parent 1f211fb37b
commit d19e757e1c
3 changed files with 3 additions and 7 deletions

View File

@@ -125,7 +125,7 @@ void add_path_component(char *path, const char *component)
path[l] = '/';
path[l+1] = 0;
}
strncat(path, component, MAX_PATH_LENGTH-1);
strlcat(path, component, MAX_PATH_LENGTH);
}
@@ -185,11 +185,11 @@ static void make_finf_path(const char *src, char *dest, bool only_dir = false)
dest[last_part-src] = 0;
// Add additional component
strncat(dest, ".finf/", MAX_PATH_LENGTH-1);
strlcat(dest, ".finf/", MAX_PATH_LENGTH);
// Add last component
if (!only_dir)
strncat(dest, last_part, MAX_PATH_LENGTH-1);
strlcat(dest, last_part, MAX_PATH_LENGTH);
}
static int create_finf_dir(const char *path)

View File

@@ -127,7 +127,6 @@ static int tftp_send_error(struct tftp_session *spt,
struct sockaddr_in saddr, daddr;
struct mbuf *m;
struct tftp_t *tp;
int nobytes;
m = m_get();
@@ -152,8 +151,6 @@ static int tftp_send_error(struct tftp_session *spt,
daddr.sin_addr = spt->client_ip;
daddr.sin_port = spt->client_port;
nobytes = 2;
m->m_len = sizeof(struct tftp_t) - 514 + 3 + strlen(msg) -
sizeof(struct ip) - sizeof(struct udphdr);

View File

@@ -548,7 +548,6 @@ void *powerpc_cpu::compile_chain_block(block_info *sbi)
// which is aligned at least on 4-byte boundaries
const int n = ((uintptr)sbi) & 3;
sbi = (block_info *)(((uintptr)sbi) & ~3L);
const uint32 bpc = sbi->pc;
const uint32 tpc = sbi->li[n].jmp_pc;
block_info *tbi = my_block_cache.find(tpc);