Permalink
Browse files

return buffers for chainability

  • Loading branch information...
steveyen committed Oct 19, 2010
1 parent bd0d300 commit e8ae0368e283b14f512949617edb62823d98eb92
Showing with 3 additions and 1 deletion.
  1. +3 −1 ntoh.js
View
@@ -13,8 +13,9 @@
* limitations under the License.
*/
exports.htons = function(b, i, v) {
- b[i] = (0xff & (v >> 8));
+ b[i+0] = (0xff & (v >> 8));
b[i+1] = (0xff & (v));
+ return b;
}
exports.ntohs = function(b, i) {
@@ -32,6 +33,7 @@ exports.htonl = function(b, i, v) {
b[i+1] = (0xff & (v >> 16));
b[i+2] = (0xff & (v >> 8));
b[i+3] = (0xff & (v));
+ return b;
}
exports.ntohl = function(b, i) {

0 comments on commit e8ae036

Please sign in to comment.