mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
misc.c/h: Change function parameter name
"template" is a c++ keyword which will make the build fail. Signed-off-by: Norbert Pocs <npocs@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Jakub Jelen
parent
d1947b55ec
commit
34baecf49a
@@ -100,7 +100,7 @@ int ssh_mkdirs(const char *pathname, mode_t mode);
|
||||
|
||||
int ssh_quote_file_name(const char *file_name, char *buf, size_t buf_len);
|
||||
int ssh_newline_vis(const char *string, char *buf, size_t buf_len);
|
||||
int ssh_tmpname(char *template);
|
||||
int ssh_tmpname(char *name);
|
||||
|
||||
char *ssh_strreplace(const char *src, const char *pattern, const char *repl);
|
||||
#ifdef __cplusplus
|
||||
|
||||
10
src/misc.c
10
src/misc.c
@@ -1836,23 +1836,23 @@ int ssh_newline_vis(const char *string, char *buf, size_t buf_len)
|
||||
*
|
||||
* @brief Replaces the last 6 characters of a string from 'X' to 6 random hexdigits.
|
||||
*
|
||||
* @param[in,out] template Any input string with last 6 characters as 'X'.
|
||||
* @param[in,out] name Any input string with last 6 characters as 'X'.
|
||||
* @returns -1 as error when the last 6 characters of the input to be replaced are not 'X'
|
||||
* 0 otherwise.
|
||||
*/
|
||||
int ssh_tmpname(char *template)
|
||||
int ssh_tmpname(char *name)
|
||||
{
|
||||
char *tmp = NULL;
|
||||
size_t i = 0;
|
||||
int rc = 0;
|
||||
uint8_t random[6];
|
||||
|
||||
if (template == NULL) {
|
||||
if (name == NULL) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
tmp = template + strlen(template) - 6;
|
||||
if (tmp < template) {
|
||||
tmp = name + strlen(name) - 6;
|
||||
if (tmp < name) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user