V804: Decreased performance
Change-Id: I6430442cc407e02810d849cf60833abe7c7d2830
This commit is contained in:
@@ -717,7 +717,8 @@ void convert_slashes(char *path)
|
|||||||
char* append_slash(char *path)
|
char* append_slash(char *path)
|
||||||
{
|
{
|
||||||
char *new_string;
|
char *new_string;
|
||||||
if ((path[strlen(path) - 1] == '/') || (path[strlen(path) - 1] == '\\')) {
|
const char cLastChar = path[strlen(path) - 1];
|
||||||
|
if (cLastChar == '/' || cLastChar == '\\') {
|
||||||
new_string = path;
|
new_string = path;
|
||||||
} else {
|
} else {
|
||||||
new_string = (char*)malloc(sizeof(char) * (strlen(path) + 2));
|
new_string = (char*)malloc(sizeof(char) * (strlen(path) + 2));
|
||||||
|
Reference in New Issue
Block a user