Use size_t for lengths in stream objects
Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
This commit is contained in:
committed by
Lauri Kasanen
parent
346fccb96c
commit
259f1055cb
@@ -49,8 +49,8 @@ namespace rfb {
|
||||
public:
|
||||
CharArray() : buf(0) {}
|
||||
CharArray(char* str) : buf(str) {} // note: assumes ownership
|
||||
CharArray(int len) {
|
||||
buf = new char[len];
|
||||
CharArray(size_t len) {
|
||||
buf = new char[len]();
|
||||
}
|
||||
~CharArray() {
|
||||
delete [] buf;
|
||||
|
||||
Reference in New Issue
Block a user