X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libctf%2Fctf-types.c;fp=libctf%2Fctf-types.c;h=ec221d734948e12faac78af46abd71c68dfb167e;hb=1a6ab13e712348c59c2757457b9f913a333f3c92;hp=6e6776223438c5c3ee99260274317d1e6183b58e;hpb=99dc3ebdfff927b30db58117d7bd80586e273669;p=deliverable%2Fbinutils-gdb.git diff --git a/libctf/ctf-types.c b/libctf/ctf-types.c index 6e67762234..ec221d7349 100644 --- a/libctf/ctf-types.c +++ b/libctf/ctf-types.c @@ -438,11 +438,12 @@ ssize_t ctf_type_lname (ctf_file_t *fp, ctf_id_t type, char *buf, size_t len) { char *str = ctf_type_aname (fp, type); - size_t slen = strlen (str); + size_t slen; if (str == NULL) return CTF_ERR; /* errno is set for us */ + slen = strlen (str); snprintf (buf, len, "%s", str); free (str);