Commit 1685d98e authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2749] Update resize() call arguments to be sizeof instead of literal values

parent 04f5b145
...@@ -260,18 +260,18 @@ uint32_t Option::getUint32() { ...@@ -260,18 +260,18 @@ uint32_t Option::getUint32() {
} }
void Option::setUint8(uint8_t value) { void Option::setUint8(uint8_t value) {
data_.resize(1); data_.resize(sizeof(value));
data_[0] = value; data_[0] = value;
} }
void Option::setUint16(uint16_t value) { void Option::setUint16(uint16_t value) {
data_.resize(2); data_.resize(sizeof(value));
writeUint16(value, &data_[0], data_.size()); writeUint16(value, &data_[0], data_.size());
} }
void Option::setUint32(uint32_t value) { void Option::setUint32(uint32_t value) {
data_.resize(4); data_.resize(sizeof(value));
writeUint32(value, &data_[0], data_.size()); writeUint32(value, &data_[0], data_.size());
} }
bool Option::equal(const OptionPtr& other) const { bool Option::equal(const OptionPtr& other) const {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment