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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
reklatsmasters authored and jasnell committed Mar 7, 2017
1 parent b3c6d97 commit 0479885
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 @@ -66,7 +66,7 @@ function WriteStream(fd) {
// Ref: https://github.com/nodejs/node/pull/1771#issuecomment-119351671
if (process.platform === 'darwin') this._handle.setBlocking(true);

var winSize = [];
var winSize = new Array(2);
var err = this._handle.getWindowSize(winSize);
if (!err) {
this.columns = winSize[0];
Expand All @@ -83,7 +83,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 0479885

Please sign in to comment.