2004-12-08 00:23:07

by wim delvaux

[permalink] [raw]
Subject: [Bluez-users] valgrind complains

about unintialized values in the following code

struct hci_dev_info di;

di.dev_id = dev_id;

if( ioctl( fd, HCIGETDEVINFO, (void*)&di) != 0 )
continue; // uh ?

printf( "%s\n", di.name ); // here valgrind complains on the third character


Should I perhaps memset ? is name field null terminated ?


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users


2004-12-08 04:02:59

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] valgrind complains

Hi Wim,

> about unintialized values in the following code
>
> struct hci_dev_info di;
>
> di.dev_id = dev_id;
>
> if( ioctl( fd, HCIGETDEVINFO, (void*)&di) != 0 )
> continue; // uh ?
>
> printf( "%s\n", di.name ); // here valgrind complains on the third character
>
>
> Should I perhaps memset ? is name field null terminated ?

maybe you should include the filename to let us know where to look.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users