From 4a04baa7154a2adf736967e8b8da4916676db8ed Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 17 Jan 2021 01:18:13 +0100 Subject: Make session log dir a command line argument --- receiver.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'receiver.cpp') diff --git a/receiver.cpp b/receiver.cpp index aaf9673..6064694 100644 --- a/receiver.cpp +++ b/receiver.cpp @@ -262,7 +262,7 @@ static void import_sessions(const char *root_dir) { closedir(dirp); } -int main() { +int main(int args, char **argv) { mbedtls_ctr_drbg_context ctr_drbg; mbedtls_entropy_context entropy; mbedtls_pk_context pk; @@ -271,7 +271,9 @@ int main() { unsigned char input[256]; size_t inputlen = 0; - chdir("sessions"); + if (args != 2) + errx(-1, "Syntax: %s [sessionlogdir]", argv[0]); + chdir(argv[1]); mbedtls_pk_init( &pk ); mbedtls_entropy_init( &entropy ); -- cgit v1.2.3