mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-27 00:03:26 +01:00
Fix possible crash.
This commit is contained in:
parent
7e0bc7768b
commit
e21e5c18ff
@ -110,7 +110,7 @@ static void chat_onFileSendRequest(ToxWindow *self, Tox *m, int num, uint8_t fil
|
|||||||
ChatContext *ctx = (ChatContext *) self->chatwin;
|
ChatContext *ctx = (ChatContext *) self->chatwin;
|
||||||
|
|
||||||
int idx = strlen(pathname) - 1;
|
int idx = strlen(pathname) - 1;
|
||||||
while (pathname[idx] == '/') {
|
while (pathname[idx] == '/' && idx >= 0) {
|
||||||
pathname[idx--] = 0;
|
pathname[idx--] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user