Fix Node.js 10 deprecation warnings

This commit is contained in:
David Stephens 2018-04-28 13:59:07 +01:00
parent 476e8f2f0c
commit f16eb6f3e6
12 changed files with 42 additions and 41 deletions

View file

@ -46,7 +46,7 @@ exports.getQuotePrefix = getQuotePrefix;
// See list here: https://github.com/Mithgol/node-fidonet-jam
function stringToNullPaddedBuffer(s, bufLen) {
let buffer = new Buffer(bufLen).fill(0x00);
let buffer = Buffer.alloc(bufLen).fill(0x00);
let enc = iconv.encode(s, 'CP437').slice(0, bufLen);
for(let i = 0; i < enc.length; ++i) {
buffer[i] = enc[i];