mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-01 16:16:46 +02:00
awhen atoi returns 0 on invalid input we don't want that to count as valid
This commit is contained in:
@ -283,7 +283,7 @@ static void chat_savefile(ToxWindow *self, ChatContext *ctx, Tox *m, uint8_t *nu
|
||||
{
|
||||
uint8_t filenum = atoi(num);
|
||||
|
||||
if (filenum < 0 || filenum >= MAX_FILES) {
|
||||
if ((filenum == 0 && strcmp(num, "0")) || filenum >= MAX_FILES) {
|
||||
wprintw(ctx->history, "No pending file transfers with that number.\n");
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user