Skip to content

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