normalizing style

This commit is contained in:
Mathias Buus 2014-03-25 20:48:23 +01:00
parent f359eba069
commit 3da78340cb
2 changed files with 16 additions and 18 deletions

View file

@ -79,7 +79,7 @@ var Extract = function(opts) {
try {
header = self._header = headers.decode(b.slice(0, 512));
} catch (err) {
self.emit('error', err)
self.emit('error', err);
}
b.consume(512);

View file

@ -196,7 +196,8 @@ exports.decode = function(buf) {
if (c === 8*32) return null;
//valid checksum
if (c === decodeOct(buf, 148))
if (c !== decodeOct(buf, 148)) throw new Error('invalid header');
return {
name: name,
mode: mode,
@ -211,8 +212,5 @@ exports.decode = function(buf) {
devmajor: devmajor,
devminor: devminor
};
//invalid checksum
throw new Error('invalid header');
};