Ignore:
Timestamp:
Apr 1, 2011, 3:07:43 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) since the JSON parser gives us the string's length, we can call tr_strndup() instead of tr_strdup()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/json.c

    r12223 r12289  
    1313#include <assert.h>
    1414#include <ctype.h>
     15#include <stdio.h>
     16#include <string.h>
    1517#include <errno.h> /* EILSEQ, EINVAL */
    1618
     
    123125            data->hasContent = true;
    124126            assert( !data->key );
    125             data->key = tr_strdup( value->vu.str.value );
     127            data->key = tr_strndup( value->vu.str.value, value->vu.str.length );
    126128            break;
    127129    }
Note: See TracChangeset for help on using the changeset viewer.