mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Rename string functions to avoid variable shadow
This commit is contained in:
parent
8de78a8b9f
commit
6f16cddd5b
5 changed files with 10 additions and 10 deletions
|
|
@ -2071,7 +2071,7 @@ static int smartctl_scan(FILE* f, tommy_list* list)
|
|||
break;
|
||||
|
||||
/* remove extraneous chars */
|
||||
s = polish(buf);
|
||||
s = strpolish(buf);
|
||||
|
||||
log_tag("smartctl:scan::text: %s\n", s);
|
||||
|
||||
|
|
|
|||
|
|
@ -682,7 +682,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
split_mac = split(split_map, SPLIT_MAX+1, buffer, ",");
|
||||
split_mac = strsplit(split_map, SPLIT_MAX+1, buffer, ",");
|
||||
|
||||
if (split_mac > SPLIT_MAX) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
|
|||
|
|
@ -588,7 +588,7 @@ bail:
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
char* polish(char* s)
|
||||
char* strpolish(char* s)
|
||||
{
|
||||
char* i = s;
|
||||
|
||||
|
|
@ -601,7 +601,7 @@ char* polish(char* s)
|
|||
return s;
|
||||
}
|
||||
|
||||
unsigned split(char** split_map, unsigned split_max, char* str, const char* delimiters)
|
||||
unsigned strsplit(char** split_map, unsigned split_max, char* str, const char* delimiters)
|
||||
{
|
||||
unsigned mac = 0;
|
||||
|
||||
|
|
@ -1399,7 +1399,7 @@ int smartctl_attribute(FILE* f, const char* file, const char* name, uint64_t* sm
|
|||
break;
|
||||
|
||||
/* remove extraneous chars */
|
||||
s = polish(buf);
|
||||
s = strpolish(buf);
|
||||
|
||||
log_tag("smartctl:%s:%s:out: %s\n", file, name, s);
|
||||
|
||||
|
|
@ -1478,7 +1478,7 @@ int smartctl_flush(FILE* f, const char* file, const char* name)
|
|||
break;
|
||||
|
||||
/* remove extraneous chars */
|
||||
s = polish(buf);
|
||||
s = strpolish(buf);
|
||||
|
||||
log_tag("smartctl:%s:%s:out: %s\n", file, name, s);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,14 +241,14 @@ static inline const char* esc_shell(const char* str, char* buffer)
|
|||
*
|
||||
* Note that the passed string is modified.
|
||||
*/
|
||||
char* polish(char* s);
|
||||
char* strpolish(char* s);
|
||||
|
||||
/**
|
||||
* Split a string in multiple tokens separated by delimiters.
|
||||
*
|
||||
* Multiple delimiters are grouped together.
|
||||
*/
|
||||
unsigned split(char** split_map, unsigned split_max, char* line, const char* delimiters);
|
||||
unsigned strsplit(char** split_map, unsigned split_max, char* line, const char* delimiters);
|
||||
|
||||
/****************************************************************************/
|
||||
/* path */
|
||||
|
|
|
|||
|
|
@ -130,8 +130,8 @@ static int devresolve_proc(uint64_t device, char* path, size_t path_size)
|
|||
separator += 3;
|
||||
|
||||
/* split the line */
|
||||
first_mac = split(first_map, 8, s, " \t\r\n");
|
||||
second_mac = split(second_map, 8, separator, " \t\r\n");
|
||||
first_mac = strsplit(first_map, 8, s, " \t\r\n");
|
||||
second_mac = strsplit(second_map, 8, separator, " \t\r\n");
|
||||
|
||||
/* if too short, it's the wrong line */
|
||||
if (first_mac < 5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue