diff options
author | Tyler Hicks <tyhicks@canonical.com> | 2014-10-23 10:16:06 -0400 |
---|---|---|
committer | Tyler Hicks <tyhicks@canonical.com> | 2014-10-29 19:32:59 -0400 |
commit | 831115af5ca36d713355bf1b379081691eca8b3f (patch) | |
tree | b2abf31251b69dec1ce66f07d1788011a68dd449 /fs/ecryptfs | |
parent | 332b122d39c9cbff8b799007a825d94b2e7c12f2 (diff) |
eCryptfs: Remove unnecessary casts when parsing packet lengths
The elements in the data array are already unsigned chars and do not
need to be casted.
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Diffstat (limited to 'fs/ecryptfs')
-rw-r--r-- | fs/ecryptfs/keystore.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 635e8e16a5b7..917bd5c9776a 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
@@ -100,12 +100,12 @@ int ecryptfs_parse_packet_length(unsigned char *data, size_t *size, | |||
100 | (*size) = 0; | 100 | (*size) = 0; |
101 | if (data[0] < 192) { | 101 | if (data[0] < 192) { |
102 | /* One-byte length */ | 102 | /* One-byte length */ |
103 | (*size) = (unsigned char)data[0]; | 103 | (*size) = data[0]; |
104 | (*length_size) = 1; | 104 | (*length_size) = 1; |
105 | } else if (data[0] < 224) { | 105 | } else if (data[0] < 224) { |
106 | /* Two-byte length */ | 106 | /* Two-byte length */ |
107 | (*size) = (((unsigned char)(data[0]) - 192) * 256); | 107 | (*size) = (data[0] - 192) * 256; |
108 | (*size) += ((unsigned char)(data[1]) + 192); | 108 | (*size) += data[1] + 192; |
109 | (*length_size) = 2; | 109 | (*length_size) = 2; |
110 | } else if (data[0] == 255) { | 110 | } else if (data[0] == 255) { |
111 | /* If support is added, adjust ECRYPTFS_MAX_PKT_LEN_SIZE */ | 111 | /* If support is added, adjust ECRYPTFS_MAX_PKT_LEN_SIZE */ |