Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed warnings

  • Loading branch information...
commit 677be12a02166da44cd22d8acc06af5ec05f1b06 1 parent 41ec22c
@joeferner joeferner authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/pcap-parser.js
View
7 lib/pcap-parser.js
@@ -41,6 +41,7 @@ function parseGlobalHeader() {
var buffer = this.buffer;
if (buffer.length >= GLOBAL_HEADER_LENGTH) {
+ var msg;
var magicNumber = buffer.toString('hex', 0, 4);
// determine pcap endianness
@@ -51,7 +52,7 @@ function parseGlobalHeader() {
} else {
this.errored = true;
this.stream.pause();
- var msg = util.format('unknown magic number: %s', magicNumber);
+ msg = util.format('unknown magic number: %s', magicNumber);
this.emit('error', new Error(msg));
onEnd.call(this);
return false;
@@ -70,7 +71,7 @@ function parseGlobalHeader() {
if (header.majorVersion != 2 && header.minorVersion != 4) {
this.errored = true;
this.stream.pause();
- var msg = util.format('unsupported version %d.%d. pcap-parser only parses libpcap file format 2.4', header.majorVersion, header.minorVersion);
+ msg = util.format('unsupported version %d.%d. pcap-parser only parses libpcap file format 2.4', header.majorVersion, header.minorVersion);
this.emit('error', new Error(msg));
onEnd.call(this);
} else {
@@ -148,4 +149,4 @@ util.inherits(Parser, events.EventEmitter);
exports.parse = function (input) {
return new Parser(input);
-}
+};
Please sign in to comment.
Something went wrong with that request. Please try again.