1
0
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:
Jfreegman
2013-10-20 07:16:26 -04:00
parent 77de8dd116
commit 407d28bf5d
3 changed files with 9 additions and 10 deletions

View File

@ -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;
}