You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: library writes to stdout via stray printf in load_config_clean #109
src/dedx.c, in load_config_clean(), contains a debug leftover:
if (config->elements_length==0) {
printf("error \n");
*err=DEDX_ERR_TARGET_NOT_FOUND;
return-1;
}
A library must never write to stdout. Any consumer that uses stdout as a data channel (CLI pipes, the WASM build, scripts) can have its output corrupted by this stray line. The printf also adds no diagnostic value — the error is already reported through *err.
Steps to reproduce
Call the API with a custom-compound configuration (target resolves to a compound not found in the embedded data) such that dedx_internal_evaluate_compound() yields elements_length == 0, then observe error printed to stdout while *err is set to DEDX_ERR_TARGET_NOT_FOUND.
Expected
No output on stdout; the error is communicated solely via *err / the return value.
Proposed change
Delete the printf("error \n"); line. (Optionally route genuine diagnostics through a caller-controlled callback in a separate issue — out of scope here.)
Acceptance criteria
No printf/fprintf(stdout, …) calls remain in src/dedx.c.
The not-found path still sets *err = DEDX_ERR_TARGET_NOT_FOUND and returns -1.
Activity