Skip to content

Invalid tests for 0xD5 in received s3g/x3g frames #15

@dcnewman

Description

@dcnewman

Since compiler warnings were disabled with -w, these two important warnings went unnoticed,

gpx.c:5445:38: warning: comparison of constant 213 with expression of type
'char' is always true [-Wtautological-constant-out-of-range-compare]
if(gpx->buffer.in[0] != 0xD5) {
gpx.c:5460:42: warning: comparison of constant 213 with expression of type
'char' is always false [-Wtautological-constant-out-of-range-compare]
if(gpx->buffer.in[0] == 0xD5) break;

Ooops. A fix is to cast to (unsigned char)

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