Compare commits

...

2 Commits

Author SHA1 Message Date
r4
9174c1b23a Fix make test 2022-10-01 20:00:48 +02:00
r4
154c6a31b9 fix error check 2022-10-01 19:59:34 +02:00
2 changed files with 3 additions and 3 deletions

View File

@ -51,7 +51,7 @@ uninstall:
rm -f $(DESTDIR)$(CFGPREFIX)/systemd/system/$(EXE).service rm -f $(DESTDIR)$(CFGPREFIX)/systemd/system/$(EXE).service
test: test:
$(GO) test -count=1 -v $(EXE)/extractor $(GO) test -count=1 -v git.nobrain.org/r4/dischord/extractor/
.PHONY: all debug fmt install uninstall clean .PHONY: all debug fmt install uninstall clean

View File

@ -140,7 +140,7 @@ func getDecryptFunction(baseJs string) (string, error) {
} }
fn := baseJs[start+len(startMatch):] fn := baseJs[start+len(startMatch):]
end := strings.Index(fn, endMatch) end := strings.Index(fn, endMatch)
if start == -1 { if end == -1 {
return "", ErrDecryptGettingFunction return "", ErrDecryptGettingFunction
} }
return fn[:end], nil return fn[:end], nil
@ -170,7 +170,7 @@ func getDecryptOps(baseJs string) ([]decryptorOp, error) {
} }
ops = baseJs[start+len(startMatch):] ops = baseJs[start+len(startMatch):]
end := strings.Index(ops, endMatch) end := strings.Index(ops, endMatch)
if start == -1 { if end == -1 {
return nil, ErrDecryptGettingOpTable return nil, ErrDecryptGettingOpTable
} }
ops = ops[:end] ops = ops[:end]