diff options
Diffstat (limited to 'src/bencoding.c')
-rw-r--r-- | src/bencoding.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; |