send_files() and send_files_multithreaded() return -1 on failure. client_cli.c then returns this value directly from main(). Returning a negative value from main() is implementation-defined behavior (typically the lower 8 bits are interpreted as an unsigned exit code, so -1 becomes 255, but this is not portable or intentional).
Location
src/client/client_send.c:230-232, 426, 485
src/client/client_cli.c:305 — return exit_code; where exit_code may be -1.
Suggested fix
Define clear exit codes: 0 for success, 1 for general error, 2 for network/config error, etc.
Return 1 (or a named constant) instead of -1 from the transfer functions.
Severity
Medium
Category
bug
This issue was automatically generated by the issue-creator agent.
## Description
`send_files()` and `send_files_multithreaded()` return `-1` on failure. `client_cli.c` then returns this value directly from `main()`. Returning a negative value from `main()` is implementation-defined behavior (typically the lower 8 bits are interpreted as an unsigned exit code, so `-1` becomes 255, but this is not portable or intentional).
## Location
- `src/client/client_send.c:230-232`, `426`, `485`
- `src/client/client_cli.c:305` — `return exit_code;` where `exit_code` may be `-1`.
## Suggested fix
1. Define clear exit codes: `0` for success, `1` for general error, `2` for network/config error, etc.
2. Return `1` (or a named constant) instead of `-1` from the transfer functions.
## Severity
Medium
## Category
bug
---
_This issue was automatically generated by the issue-creator agent._
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
send_files()andsend_files_multithreaded()return-1on failure.client_cli.cthen returns this value directly frommain(). Returning a negative value frommain()is implementation-defined behavior (typically the lower 8 bits are interpreted as an unsigned exit code, so-1becomes 255, but this is not portable or intentional).Location
src/client/client_send.c:230-232,426,485src/client/client_cli.c:305—return exit_code;whereexit_codemay be-1.Suggested fix
0for success,1for general error,2for network/config error, etc.1(or a named constant) instead of-1from the transfer functions.Severity
Medium
Category
bug
This issue was automatically generated by the issue-creator agent.