Giter Club home page Giter Club logo

adifparser's Introduction

adifparser's People

Contributors

adrianboyko avatar diablowu avatar jasonhancock avatar jj1bdx avatar matir avatar xylo04 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

adifparser's Issues

Wrong trim causes array out of bounds

Description:
If there are blank characters in the field content, for example: <comment:3>C: <eor>,adifreader.go#ReadRecord will be panic.

Panic:

panic: runtime error: slice bounds out of range [3:2] [recovered]
	panic: runtime error: slice bounds out of range [3:2]

......................

	<Path>/vendor/github.com/Matir/adifparser/adifrecord.go:119 +0x528
github.com/Matir/adifparser.ParseADIFRecord({0xc0000f2400, 0xd, 0x400})
	<Path>/vendor/github.com/Matir/adifparser/adifrecord.go:69 +0x18e
github.com/Matir/adifparser.(*baseADIFReader).ReadRecord(0xc0000d0b00)
	<Path>/vendor/github.com/Matir/adifparser/adifreader.go:51 +0x105

Possible problems:
https://github.com/Matir/adifparser/blob/master/adifreader.go#L166

VY 73 DE BI1NIZ

LotW output now includes an EOF tag

I used https://github.com/k0swe/lotw-qsl/blob/main/cmd/lotw-qsl/main.go to download a log of my LotW activity. A snippet of the end of the file:

<CALL:5>K7WXB^M
<BAND:3>40M^M
<FREQ:7>7.07505^M
<MODE:3>FT8^M
<APP_LoTW_MODEGROUP:4>DATA^M
<QSO_DATE:8>20200901^M
<APP_LoTW_RXQSO:19>2020-10-21 04:59:04 // QSO record inserted/modified at LoTW^M
<TIME_ON:6>222600^M
<APP_LoTW_QSO_TIMESTAMP:20>2020-09-01T22:26:00Z // QSO Date & Time; ISO-8601^M
<QSL_RCVD:1>Y^M
<QSLRDATE:8>20201021^M
<APP_LoTW_RXQSL:19>2020-10-21 04:59:04 // QSL record matched/modified at LoTW^M
<DXCC:3>291^M
<COUNTRY:24>UNITED STATES OF AMERICA^M
<APP_LoTW_DXCC_ENTITY_STATUS:7>Current^M
<PFX:2>K7^M
<APP_LoTW_2xQSL:1>Y^M
<GRIDSQUARE:8>DN40DA49^M
<STATE:2>UT // Utah^M
<CNTY:7>UT,UTAH // Utah^M
<CQZ:2>03^M
<ITUZ:2>06^M
<eor>^M
^M
<APP_LoTW_EOF>^M
^M

I then tried to parse it, but it seems the <APP_LoTW_EOF> tag is causing an issue resulting in the error Invalid field definition.

Add ADIFRecord.SetValue

I'm finally in a position where I want to mutate an ADIF record (actually, create a new ADIFRecord and fill it from a proto, the reverse of this file). Despite the fact that there's the NewADIFRecord function for creating an empty ADIFRecord, there appears to be no way currently to mutate an ADIFRecord.

I'm going to send a PR to fix this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.