Skip to content

Non-portable %f scanning into float without width limit; potential precision/UB mismatch not enforced #16

Description

@XenonofArcticus

Where: DEFGSupport.cpp, fscanf

Why it’s wrong: %f is correct for float*, but the code later passes these to AddPoint(double,double,double) after negation; the precision truncation may not be intended for elevation data. If %lf was expected for double, this is an input precision bug.

Evidence: Variable types and format string.
GitHub

Fix: If inputs are double precision, change variables to double and use %lf; otherwise document the precision loss.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions