1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-23 19:43:26 +01:00

Merge pull request #59 from FullName/path-idx-real-fix

Fix partial fix: A slash in pos 0 still led to read access to pathname[-1].
This commit is contained in:
JFreegman 2013-11-30 16:26:30 -08:00
commit 8f1da153a7

View File

@ -113,7 +113,7 @@ static void chat_onFileSendRequest(ToxWindow *self, Tox *m, int num, uint8_t fil
ChatContext *ctx = self->chatwin;
int idx = strlen(pathname) - 1;
while (pathname[idx] == '/' && idx >= 0) {
while (idx >= 0 && pathname[idx] == '/') {
pathname[idx--] = 0;
}