Skip to content

asciitohex adjust to end string correctly #18

@jps1x2

Description

@jps1x2

HI mcore1976!

Function asciitohex is finishing string 2 chars after last written hex value. I am playing with your code and making some adjustements.

File: cc1101-tool-esp32-wroom.ino
Line: 103 hex_ptr[(2*i)+2] = '\0' ;
Correction: hex_ptr[(2*i)] = '\0' ;

Reason: variable i exits incremented from previous for bucle.
When code reaches line 103, i variable has the needed value to finish string fine adding \0, it is not needed to add 2 more char positions to it.

Regards!

Jps1x2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions