count = *ptr_loc;
}
- if (count > MAX_SLICE_LENGTH * 4) {
- count = MAX_SLICE_LENGTH * 4;
+ if (count > MAX_SLICE_LENGTH) {
+ count = MAX_SLICE_LENGTH;
}
return count;
}
if (debug->send_buffer.length > 0) {
- send(debug->client_fd, &debug->send_buffer.length, sizeof(i32), 0);
send(debug->client_fd, debug->send_buffer.data, debug->send_buffer.length, 0);
bh_buffer_clear(&debug->send_buffer);
}
let len = this.parseUint32();
let str = "";
for (let i = 0; i < len; i++) {
+ if (this.offset + i >= this.data.length) {
+ break;
+ }
str += String.fromCharCode(this.view.getUint8(this.offset + i));
}
this.offset += len;
let len = this.parseUint32();
let str = "";
for (let i=0; i<len; i++) {
+ if (this.offset + i >= this.data.length) {
+ break;
+ }
+
str += String.fromCharCode(this.view.getUint8(this.offset + i));
}
this.offset += len;