From 0658b5f237209f46b0e6e74dc29a0060351ded19 Mon Sep 17 00:00:00 2001 From: qorg11 Date: Tue, 9 Feb 2021 19:01:49 +0100 Subject: [PATCH] fugging strlen :DDDD --- clainsafecli/clainsafecli.c | 11 ++++++++++- clainsafecli/options.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/clainsafecli/clainsafecli.c b/clainsafecli/clainsafecli.c index 28ebff4..06a3a30 100644 --- a/clainsafecli/clainsafecli.c +++ b/clainsafecli/clainsafecli.c @@ -49,7 +49,7 @@ main(int argc, char **argv) long_options,&option_index)) != -1) { switch(c) { case 's': - strncpy(server,optarg,256); + server = optarg; break; case 'h': print_help(); @@ -165,3 +165,12 @@ store_link(const char *path, const char *buf) fputc('\n',fp); return 0; } + +void +print_help() +{ + printf("--server : specifies the lainsafe server\n%s\n%s", + "--tor: uses tor", + "--help: print this message\n"); + return; +} diff --git a/clainsafecli/options.h b/clainsafecli/options.h index fa267dc..fadb818 100644 --- a/clainsafecli/options.h +++ b/clainsafecli/options.h @@ -1,7 +1,7 @@ /* clainsafecli options */ /* Default server you'll upload files to */ -char server[256] = "https://lainsafe.kalli.st"; +char *server = "https://lainsafe.kalli.st"; /* proxy urls, socks and http. in that order, by default they're * configured to be used for tor and i2p, but if you have another