Re: To enablue DID in coming bluez release

Johan Hedberg
2008-12-16T10:29:28Z

Hi,

Couple of comments:

On Tue, Dec 16, 2008, Li, Zhigang wrote:
> main_opts.inqmode = val;
> }
> + str = g_key_file_get_string(config, "General",

Coding style: add empty line after the closing bracket.

> + "VID/PID/VER", &err);

Did you agree with this "VID/PID/VER" name with Marcel? I'd have used
something like "DeviceID", "DeviceIDInfo" or "DIDInfo".

> + strcpy( main_opts.deviceid,str);

First, coding style: remove the extra space after the opening
parenthesis and add the missing one after the comma. Second, you're
overflowing main_opts.deviceid if the string provided in main.conf is
longer than 14 characters. So the call should be:
strncpy(main_opts.deviceid, src, sizeof(main_opts.deviceid));

Johan