summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.c b/main.c
index 6dde7ee..f9e3092 100644
--- a/main.c
+++ b/main.c
@@ -1319,6 +1319,17 @@ int main(int argc, char *argv[])
1319 load_rules(); 1319 load_rules();
1320 } 1320 }
1321 1321
1322 /* If shared secret has not been provided via -s, read from TUNTOX_SHARED_SECRET env variable */
1323 if(!use_shared_secret)
1324 {
1325 if(getenv("TUNTOX_SHARED_SECRET") != NULL)
1326 {
1327 use_shared_secret = 1;
1328 memset(shared_secret, 0, TOX_MAX_FRIEND_REQUEST_LENGTH);
1329 strncpy(shared_secret, getenv("TUNTOX_SHARED_SECRET"), TOX_MAX_FRIEND_REQUEST_LENGTH-1);
1330 }
1331 }
1332
1322 if(daemonize) 1333 if(daemonize)
1323 { 1334 {
1324 do_daemonize(); 1335 do_daemonize();