Navigation Menu

Skip to content

Commit

Permalink
fixed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
joeferner committed Feb 5, 2013
1 parent 41ec22c commit 677be12
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/pcap-parser.js
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -148,4 +149,4 @@ util.inherits(Parser, events.EventEmitter);

exports.parse = function (input) {
return new Parser(input);
}
};

0 comments on commit 677be12

Please sign in to comment.