mirror of
https://github.com/curl/curl.git
synced 2026-07-23 16:47:15 +03:00
snprintf: renamed and we now only use msnprintf()
The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
This commit is contained in:
parent
9944d6ba33
commit
dcd6f81025
92 changed files with 632 additions and 631 deletions
|
|
@ -1342,8 +1342,8 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||
break;
|
||||
}
|
||||
|
||||
snprintf(sshc->readdir_linkPath, PATH_MAX, "%s%s", protop->path,
|
||||
sshc->readdir_filename);
|
||||
msnprintf(sshc->readdir_linkPath, PATH_MAX, "%s%s", protop->path,
|
||||
sshc->readdir_filename);
|
||||
|
||||
state(conn, SSH_SFTP_READDIR_LINK);
|
||||
break;
|
||||
|
|
@ -1406,12 +1406,12 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||
}
|
||||
sshc->readdir_line = new_readdir_line;
|
||||
|
||||
sshc->readdir_currLen += snprintf(sshc->readdir_line +
|
||||
sshc->readdir_currLen,
|
||||
sshc->readdir_totalLen -
|
||||
sshc->readdir_currLen,
|
||||
" -> %s",
|
||||
sshc->readdir_filename);
|
||||
sshc->readdir_currLen += msnprintf(sshc->readdir_line +
|
||||
sshc->readdir_currLen,
|
||||
sshc->readdir_totalLen -
|
||||
sshc->readdir_currLen,
|
||||
" -> %s",
|
||||
sshc->readdir_filename);
|
||||
|
||||
sftp_attributes_free(sshc->readdir_link_attrs);
|
||||
sshc->readdir_link_attrs = NULL;
|
||||
|
|
@ -1421,10 +1421,10 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||
state(conn, SSH_SFTP_READDIR_BOTTOM);
|
||||
/* FALLTHROUGH */
|
||||
case SSH_SFTP_READDIR_BOTTOM:
|
||||
sshc->readdir_currLen += snprintf(sshc->readdir_line +
|
||||
sshc->readdir_currLen,
|
||||
sshc->readdir_totalLen -
|
||||
sshc->readdir_currLen, "\n");
|
||||
sshc->readdir_currLen += msnprintf(sshc->readdir_line +
|
||||
sshc->readdir_currLen,
|
||||
sshc->readdir_totalLen -
|
||||
sshc->readdir_currLen, "\n");
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BODY,
|
||||
sshc->readdir_line,
|
||||
sshc->readdir_currLen);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue