diff options
author | Stefan Kropp <stefan.kropp@posteo.de> | 2022-04-30 22:10:21 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2022-05-03 23:00:11 +0200 |
commit | c9e6a89aeaea87daaf572edefe3f9dc5d48e912e (patch) | |
tree | ceb79f2878693302e4fc2aa937921779d2e4eaa2 /src | |
parent | 62018f48c5f1a0410445fce5bca5fdd6a9e4d907 (diff) | |
download | profani-tty-c9e6a89aeaea87daaf572edefe3f9dc5d48e912e.tar.gz |
Bugfix OX rpad generation
________________________________________ < No comment - should be much better now > ---------------------------------------- \ \ \ >()_ (__)__ _
Diffstat (limited to 'src')
-rw-r--r-- | src/xmpp/message.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c index c18f9376..fb58285e 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -1616,11 +1616,13 @@ _openpgp_signcrypt(xmpp_ctx_t* ctx, const char* const to, const char* const text struct tm* tm = localtime(&now); char buf[255]; strftime(buf, sizeof(buf), "%FT%T%z", tm); - int randnr = rand() % 5; - char rpad_data[randnr]; - for (int i = 0; i < randnr - 1; i++) { - rpad_data[i] = 'c'; + // build rpad + int randnr = (rand() % 100) + 1; + char rpad_data[randnr]; + for (int i = 0; i < randnr; i++) { + int rchar = (rand() % 52) + 65; + rpad_data[i] = rchar; } rpad_data[randnr - 1] = '\0'; |