Add Error Messages & Improve Error Handling#88
Conversation
Greptile SummaryThis PR adds Confidence Score: 5/5Safe to merge after renaming Only P2 (style) findings remain; the previously-flagged logic bugs (stale pointer, format specifiers, non-null-terminated centrallix-lib/src/cxsec.c — minor label-naming convention mismatch.
|
| Filename | Overview |
|---|---|
| centrallix-lib/src/cxsec.c | Adds warning output on invalid-symbol paths in cxsecVerifySymbol and cxsecVerifySymbol_n; correctly saves original pointer/length before mutation, but uses err: label instead of the project-mandated error: label. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["cxsecVerifySymbol(sym)"] --> B["save original_symbol = sym"]
B --> C{"First char valid?\n[A-Za-z_]"}
C -- No --> E["goto err\nfprintf(stderr, WARNING '%s'...)"]
C -- Yes --> D["walk remaining chars"]
D --> F{"All chars valid?\n[A-Za-z0-9_]"}
F -- No --> E
F -- Yes --> G["return 0"]
E --> H["return -1"]
A2["cxsecVerifySymbol_n(sym, n)"] --> B2["save original_symbol, original_n"]
B2 --> C2{"n==0 or first char invalid?"}
C2 -- Yes --> E2["goto err\nfprintf(stderr, WARNING '%.*s'...)"]
C2 -- No --> D2["walk n-1 remaining chars"]
D2 --> F2{"All chars valid?"}
F2 -- No --> E2
F2 -- Yes --> G2["return 0"]
E2 --> H2["return -1"]
Reviews (4): Last reviewed commit: "Apply changes to cxsecVerifySymbol()." | Re-trigger Greptile
|
@greptileai Please re-review this PR and let me know if you have any other comments, or let me know if the PR is ready to merge. |
|
@greptileai I fixed your previous issues and also made more changes. Double check that the previous issues are fixed and scan the new changes to ensure that they don't have any issues. |
|
PR cleared for human review. |
Changes extracted from #85.
Should not affect business logic, other than improving error case handling. Review should be easy.