diff --git a/rtlsdr.go b/rtlsdr.go index b3f7320..0bd515c 100644 --- a/rtlsdr.go +++ b/rtlsdr.go @@ -271,15 +271,15 @@ func (dev *Context) WriteEeprom(data []uint8, offset uint8, leng uint16) (err er C.uint8_t(offset), C.uint16_t(leng))) switch { - case i == 0: - return + default: + err = nil case i == -1: err = errors.New("device handle is invalid") case i == -2: err = errors.New("EEPROM size exceeded") case i == -3: err = errors.New("no EEPROM was found") - default: + case i < -4: err = errors.New("unknown error") } return