From cf3f6750eb836acdf758f3b409b826f555217976 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Sun, 14 Sep 2014 18:25:13 -0400 Subject: [PATCH] small fix --- src/toxic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/toxic.c b/src/toxic.c index 07e3b4d..a948f29 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -508,7 +508,7 @@ static void first_time_running(void) system("clear"); printf("Encrypt data file? Y/n \n"); - if (!strcasecmp(ch, "y\n") || !strcasecmp(ch, "n\n")) + if (!strcmp(ch, "y\n") || !strcmp(ch, "n\n")) break; } while (fgets(ch, sizeof(ch), stdin)); @@ -901,9 +901,9 @@ int main(int argc, char *argv[]) /* Make sure all written files are read/writeable only by the current user. */ umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); int config_err = init_default_data_files(); - bool first_run = !file_exists(DATA_FILE); - if (first_run) + /* if first time using given data file prompt for data encryption */ + if (!file_exists(DATA_FILE)) first_time_running(); /* init user_settings struct and load settings from conf file */