mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +00:00
(trunk libT) since the JSON parser gives us the string's length, we can call tr_strndup() instead of tr_strdup()
This commit is contained in:
parent
4184f73c99
commit
cdabd1b5eb
1 changed files with 3 additions and 1 deletions
|
@ -12,6 +12,8 @@
|
|||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h> /* EILSEQ, EINVAL */
|
||||
|
||||
#include "JSON_parser.h"
|
||||
|
@ -122,7 +124,7 @@ callback( void * vdata,
|
|||
case JSON_T_KEY:
|
||||
data->hasContent = true;
|
||||
assert( !data->key );
|
||||
data->key = tr_strdup( value->vu.str.value );
|
||||
data->key = tr_strndup( value->vu.str.value, value->vu.str.length );
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue