Created
September 23, 2011 14:26
-
-
Save rootslab/1237478 to your computer and use it in GitHub Desktop.
(NodeJs) Buffer Size bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/joyent/node/blob/master/lib/buffer.js R#~208 | |
... | |
// Are we slicing? | |
if (typeof offset === 'number') { | |
this.length = Math.floor( encoding ); // <-- probably also here | |
this.parent = subject; | |
this.offset = offset; | |
} else { | |
// Find the length | |
switch (type = typeof subject) { | |
case 'number': | |
this.length = Math.floor( subject ); // <-- here | |
break; | |
switch (type = typeof subject) { | |
case 'number': | |
this.length = | |
break; | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try this code :