diff options
author | David Sterba <dsterba@suse.com> | 2016-11-15 14:41:54 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-11-23 10:50:01 +0100 |
commit | 2513dfed8f5abd568a818e4222c17159b73da01f (patch) | |
tree | 646093ec7c01dd00ddf35ca0266d4a24b0eda1fc /send-stream.c | |
parent | 23ac27781eb54ccdc60b2738f2d3ea1ff67966df (diff) |
btrfs-progs: send-stream: change length type to unsigned
The command length is unsigned, use the right type, also to make the
length checks work.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'send-stream.c')
-rw-r--r-- | send-stream.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/send-stream.c b/send-stream.c index 450854f6..31e9a7b5 100644 --- a/send-stream.c +++ b/send-stream.c @@ -71,11 +71,11 @@ static int read_cmd(struct btrfs_send_stream *sctx) { int ret; int cmd; - int cmd_len; + u32 cmd_len; int tlv_type; int tlv_len; char *data; - int pos; + u32 pos; struct btrfs_tlv_header *tlv_hdr; u32 crc; u32 crc2; @@ -98,7 +98,7 @@ static int read_cmd(struct btrfs_send_stream *sctx) if (cmd_len + sizeof(*sctx->cmd_hdr) >= sizeof(sctx->read_buf)) { ret = -EINVAL; - error("command length %d too big for buffer %zu", + error("command length %u too big for buffer %zu", cmd_len, sizeof(sctx->read_buf)); goto out; } |