Skip to content

Commit

Permalink
change new buffer to buffer.alloc (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
muz3 authored and mcollina committed Jul 28, 2019
1 parent 371379d commit caf3944
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function genHeader (type) {
return [0, 1, 2].map(function (qos) {
return [0, 1].map(function (dup) {
return [0, 1].map(function (retain) {
var buf = new Buffer(1)
var buf = Buffer.alloc(1)
buf.writeUInt8(
protocol.codes[type] << protocol.CMD_SHIFT |
(dup ? protocol.DUP_MASK : 0) |
Expand Down

0 comments on commit caf3944

Please sign in to comment.