SDL: Mark some parameters as const

This commit is contained in:
Clownacy 2020-12-14 20:33:33 +00:00 committed by Rafael Kitover
parent d412711465
commit 2a237aea6b
1 changed files with 4 additions and 4 deletions

View File

@ -321,10 +321,10 @@ bool sdlCheckDirectory(const char* dir)
}
}
char* sdlGetFilename(char* name)
char* sdlGetFilename(const char* name)
{
char path[1024];
char *filename = strrchr(name, FILE_SEP);
const char *filename = strrchr(name, FILE_SEP);
if (filename)
strcpy(path, filename + 1);
else
@ -332,10 +332,10 @@ char* sdlGetFilename(char* name)
return strdup(path);
}
char* sdlGetFilePath(char* name)
char* sdlGetFilePath(const char* name)
{
char path[1024];
char *filename = strrchr(name, FILE_SEP);
const char *filename = strrchr(name, FILE_SEP);
if (filename) {
size_t length = strlen(name) - strlen(filename);
memcpy(path, name, length);