mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-02 20:34:41 +00:00
(svn r17689) -Fix (r16307): depend could segfault in some case (TrueBrain)
This commit is contained in:
parent
c344ae2e1d
commit
1e665c7639
@ -426,7 +426,8 @@ const char *GeneratePath(const char *dirname, const char *filename, bool local)
|
||||
/* Remove '..' from the begin of the filename. */
|
||||
while (*p == '.') {
|
||||
if (*(++p) == '.') {
|
||||
*(strrchr(path, '/')) = '\0';
|
||||
char *s = strrchr(path, '/');
|
||||
if (s != NULL) *s = '\0';
|
||||
p += 2;
|
||||
}
|
||||
}
|
||||
@ -443,7 +444,8 @@ const char *GeneratePath(const char *dirname, const char *filename, bool local)
|
||||
/* Remove '..' from the begin of the filename. */
|
||||
while (*p == '.') {
|
||||
if (*(++p) == '.') {
|
||||
*(strrchr(path, '/')) = '\0';
|
||||
char *s = strrchr(path, '/');
|
||||
if (s != NULL) *s = '\0';
|
||||
p += 2;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user