Commit Graph

4 Commits (75e6f253c9d041043275a5051584bf63ccc6f41a)

Author SHA1 Message Date
nirenjan b6e61fc54e fix: Avoid backward jumps using goto
SonarQube cloud identified a maintainability issue based on MISRA C
guidelines that prohibit backward jumps. While not a mandatory fix, it
helps to clean up the codebase and improves readability.

Ref. MISRA C:2012, 15.2 - The goto statement shall jump to a label
declared later in the same function.
2026-03-12 08:34:58 -07:00
nirenjan 2fa9f52ddb build: Fix the GCC pragma to only apply for GCC > 13
The -Wanalyzer-fd-leak flag was introduced in GCC 13, so this pragma
fails to build on older GCC versions.
2026-03-09 00:26:06 -07:00
nirenjan a17312dcbc fix: Fix potential error scenarios
Configuring the build with CFLAGS="-O2 -g -fanalyzer", we ran into some
build errors, which we address in this commit.

First off, GCC identified a false positive file descriptor leak in
x52d_client.c, this instance is suppressed to avoid breaking the build.

There was a bug in x52d_clock.c, where if the original timezone could
not have a copy due to malloc failure, it would fail when resetting the
TZ environment. This is fixed by ensuring the copy is valid.

Finally, there was a potential NULL pointer dereference if the pinelog
module messes up the log levels, and the lmap_get_string method ends up
returning a NULL which was passed to the DATA macro. This is fixed by
checking for NULL and handling it in case of failure.
2026-03-09 00:13:19 -07:00
nirenjan 619d516ccc Add notify API
This change adds a notification API to libx52dcomm. It also pulls in the
logic to join multiple arguments into a single buffer for later use.
2022-09-06 23:19:03 -07:00