Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix three compile warnings #221

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

critkitten
Copy link

fix three compile warnings

…stringop-overread]

In function ‘allocate_paths’,
    inlined from ‘xfer_options_parse_args’ at xfer-options.c:388:8:
xfer-options.c:69:34: warning: ‘strndup’ specified bound 4096 exceeds source size 2 [-Wstringop-overread]
   69 |                 xfer->paths[0] = strndup("-", PATH_MAX);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~
…write(receive_file, buf, length); if (bytes_written != length) { // handle the error, e.g., print an error message or break the loop error("write() failed:

fix  ssize_t bytes_written;  if (receive_file != -1) {     bytes_written = write(receive_file, buf, length);     if (bytes_written != length) {         // handle the error, e.g., print an error message or brea
… with attribute ‘warn_unused_result’ [-Wunused-result]

fix utils.c:94:15: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant