From 5aed85d8cdc3301c9f9a68d89d21ae7b1bf1658f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Wed, 15 Mar 2023 20:26:21 +0100 Subject: added env var TTL COOLDOWN TOOMUCH --- src/bencoding.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bencoding.c') diff --git a/src/bencoding.c b/src/bencoding.c index 991ac9c..0fb2588 100644 --- a/src/bencoding.c +++ b/src/bencoding.c @@ -328,7 +328,7 @@ char * b2json (char * dest, struct bencoding * b) { if (b->type & num) { char buf[512]; sprintf(buf, "%ld", b->intvalue); - strncpy(dest, buf, strlen(buf)); + strcpy(dest, buf); return dest+strlen(buf); } if (b->type & (list | dict)) { @@ -708,13 +708,13 @@ char * bencode (char * dest, struct bencoding * b) { dest = bencode(dest, b->key); if (b->type & num) { sprintf(buf, "i%ld", b->intvalue); - strncpy(dest, buf, strlen(buf)); + strcpy(dest, buf); dest += strlen(buf); *dest++ = 'e'; } if (b->type & string) { sprintf(buf, "%zu:", b->valuelen); - strncpy(dest, buf, strlen(buf)); + strcpy(dest, buf); dest += strlen(buf); memcpy(dest, b->value, b->valuelen); dest += b->valuelen; -- cgit v1.2.3