Skip to content

Add Realpath() for jslisten.c #38

@NerdAlert2023

Description

@NerdAlert2023

Enhancement: Add realpath() when resolving config paths to simplify the code and improve log clarity.

The current path‑handling logic in getConfigFile() relies on several chained strncpy/strncat operations. These are easy to get wrong and could cause undefined behavior.

Using realpath() after constructing the intended config path would remove most of this complexity and make the function far more robust resulting in producing a clean, canonical, absolute path for logging. It helps reduce the amount of manual string manipulation required. Canonicalizing the path after construction means fewer buffer‑size calculations, fewer chained string operations, and less risk of off‑by‑one errors or missing terminators.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions