Add Error Messages & Improve Error Handling#88
Add Error Messages & Improve Error Handling#88Lightning11wins wants to merge 4 commits intomasterfrom
Conversation
Greptile SummaryThis PR improves error handling in Key changes and observations:
Confidence Score: 3/5
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["cxsecVerifySymbol(sym)"] --> B["Save original_symbol = sym"]
B --> C{"First char valid?\n(alpha or underscore)"}
C -- No --> ERR1["goto err"]
C -- Yes --> D["sym++"]
D --> E{"while *sym != NUL"}
E -- "char invalid" --> ERR1
E -- "char valid" --> F["sym++"]
F --> E
E -- "end of string" --> G["return 0 ✓"]
ERR1 --> H["fprintf(stderr, WARNING: '%s'..., original_symbol)\nreturn -1"]
A2["cxsecVerifySymbol_n(sym, n)"] --> B2["Save original_symbol = sym\nSave original_n = n"]
B2 --> C2{"n <= 0 OR\nfirst char invalid?"}
C2 -- Yes --> ERR2["goto err"]
C2 -- No --> D2["n--; sym++"]
D2 --> E2{"while n > 0"}
E2 -- "char invalid" --> ERR2
E2 -- "char valid" --> F2["sym++; n--"]
F2 --> E2
E2 -- "n exhausted" --> G2["return 0 ✓"]
ERR2 --> H2["fprintf(stderr, WARNING: '%.*s'..., original_n, original_symbol)\nreturn -1"]
Last reviewed commit: c1fef33 |
|
@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. |
Changes extracted from #85.
Should not affect business logic, other than improving error case handling. Review should be easy.