From: Mukund Sivaraman Date: Mon, 27 Jan 2014 03:58:43 +0000 (+0530) Subject: [2749] Update resize() call arguments to be sizeof instead of literal values X-Git-Tag: bind10-1.2.0beta1-release~104^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1685d98e142c2b5915d19bf17f4029459a922321;p=thirdparty%2Fkea.git [2749] Update resize() call arguments to be sizeof instead of literal values --- diff --git a/src/lib/dhcp/option.cc b/src/lib/dhcp/option.cc index 1bfe351b5d..24ddc06854 100644 --- a/src/lib/dhcp/option.cc +++ b/src/lib/dhcp/option.cc @@ -260,18 +260,18 @@ uint32_t Option::getUint32() { } void Option::setUint8(uint8_t value) { - data_.resize(1); - data_[0] = value; + data_.resize(sizeof(value)); + data_[0] = value; } void Option::setUint16(uint16_t value) { - data_.resize(2); - writeUint16(value, &data_[0], data_.size()); + data_.resize(sizeof(value)); + writeUint16(value, &data_[0], data_.size()); } void Option::setUint32(uint32_t value) { - data_.resize(4); - writeUint32(value, &data_[0], data_.size()); + data_.resize(sizeof(value)); + writeUint32(value, &data_[0], data_.size()); } bool Option::equal(const OptionPtr& other) const {