diff options
author | John Crispin <blogic@openwrt.org> | 2014-10-20 06:29:13 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-10-20 06:29:13 +0000 |
commit | a5fc2d42b82379d31d67a396d7f2369a935b3ecf (patch) | |
tree | f8c3cfc23679bf4b69d7281dfb395efd51f84f49 /tools | |
parent | c23daabb8c455dcc940aacb55db484e62a405c89 (diff) | |
download | upstream-a5fc2d42b82379d31d67a396d7f2369a935b3ecf.tar.gz upstream-a5fc2d42b82379d31d67a396d7f2369a935b3ecf.tar.bz2 upstream-a5fc2d42b82379d31d67a396d7f2369a935b3ecf.zip |
firmware-utils: fix compilation warnings.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42986 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'tools')
-rw-r--r-- | tools/firmware-utils/src/buffalo-tftp.c | 2 | ||||
-rw-r--r-- | tools/firmware-utils/src/mkrtn56uimg.c | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/tools/firmware-utils/src/buffalo-tftp.c b/tools/firmware-utils/src/buffalo-tftp.c index 1a2551a41c..087f9955b6 100644 --- a/tools/firmware-utils/src/buffalo-tftp.c +++ b/tools/firmware-utils/src/buffalo-tftp.c @@ -70,7 +70,6 @@ static int crypt_file(void) { unsigned char *buf = NULL; ssize_t src_len; - ssize_t crypt_len; int err; int ret = -1; @@ -92,7 +91,6 @@ static int crypt_file(void) goto out; } - crypt_len = (src_len > 512) ? 512 : src_len; if (do_decrypt) crypt_header(buf, 512, crypt_key2, crypt_key1); else diff --git a/tools/firmware-utils/src/mkrtn56uimg.c b/tools/firmware-utils/src/mkrtn56uimg.c index 973ab28d06..fe9ae2c877 100644 --- a/tools/firmware-utils/src/mkrtn56uimg.c +++ b/tools/firmware-utils/src/mkrtn56uimg.c @@ -89,13 +89,13 @@ calc_crc(image_header_t *hdr, void *data, uint32_t len) /* * Calculate payload checksum */ - hdr->ih_dcrc = htonl(crc32(0, data, len)); + hdr->ih_dcrc = htonl(crc32(0, (Bytef *)data, len)); hdr->ih_size = htonl(len); /* * Calculate header checksum */ hdr->ih_hcrc = 0; - hdr->ih_hcrc = htonl(crc32(0, hdr, sizeof(image_header_t))); + hdr->ih_hcrc = htonl(crc32(0, (Bytef *)hdr, sizeof(image_header_t))); } @@ -166,7 +166,7 @@ process_image(char *progname, char *filename, op_mode_t opmode) } if (opmode == FACTORY) { - strncpy(&namebuf, (char *)&hdr->tail.ih_name, IH_NMLEN); + strncpy(namebuf, hdr->tail.ih_name, IH_NMLEN); hdr->tail.asus.kernel.major = 0; hdr->tail.asus.kernel.minor = 0; hdr->tail.asus.fs.major = 0; @@ -231,7 +231,7 @@ process_image(char *progname, char *filename, op_mode_t opmode) if (opmode == FACTORY) { hdr = ptr+offset_sec_header; memcpy(hdr, ptr, sizeof(image_header_t)); - strncpy((char *)&hdr->tail.ih_name, &namebuf, IH_NMLEN); + strncpy(hdr->tail.ih_name, namebuf, IH_NMLEN); calc_crc(hdr, ptr+offset_kernel, offset_sqfs - offset_kernel); calc_crc((image_header_t *)ptr, ptr+offset_kernel, offset_image_end - offset_kernel); } else { |