Skip to content

Commit

Permalink
[AMQCPP-150] When performing tight unmarshalling of compressed long l…
Browse files Browse the repository at this point in the history
…ong values (e.g. int and short), cast the values to unsigned, so that the sign bit will not appear in the resulting long

git-svn-id: https://svn.apache.org/repos/asf/activemq/activemq-cpp/trunk@589089 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Nathan Christopher Mittler committed Oct 27, 2007
1 parent d6a6665 commit d20dd94
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,13 @@ long long BaseDataStreamMarshaller::tightUnmarshalLong(
if( bs->readBoolean() ) {
return dataIn->readLong();
} else {
return dataIn->readInt();
return (unsigned int)dataIn->readInt();
}

} else {

if( bs->readBoolean()) {
return dataIn->readShort();
return (unsigned short)dataIn->readShort();
} else {
return 0;
}
Expand Down

0 comments on commit d20dd94

Please sign in to comment.