Skip to content

Commit

Permalink
tty: avoid oob warning in TTYWrap::GetWindowSize()
Browse files Browse the repository at this point in the history
PR-URL: #11454
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
reklatsmasters authored and addaleax committed Feb 22, 2017
1 parent f37ab79 commit 4ee9220
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function WriteStream(fd) {
// Ref: https://github.com/nodejs/node/pull/1771#issuecomment-119351671
this._handle.setBlocking(process.env.NODE_TTY_UNSAFE_ASYNC !== '1');

var winSize = [];
var winSize = new Array(2);
var err = this._handle.getWindowSize(winSize);
if (!err) {
this.columns = winSize[0];
Expand All @@ -72,7 +72,7 @@ WriteStream.prototype.isTTY = true;
WriteStream.prototype._refreshSize = function() {
var oldCols = this.columns;
var oldRows = this.rows;
var winSize = [];
var winSize = new Array(2);
var err = this._handle.getWindowSize(winSize);
if (err) {
this.emit('error', errnoException(err, 'getWindowSize'));
Expand Down

0 comments on commit 4ee9220

Please sign in to comment.