1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-02-13 11:01:58 +00:00

miracle-wifid: let the format of wfd_dev_info compliant with wfd_subelems to ease parsing

This commit is contained in:
Derek Dai 2017-01-23 17:10:52 +08:00
parent 7ea9305172
commit 8381290479
No known key found for this signature in database
GPG key ID: E109CC97553EF009

View file

@ -880,7 +880,13 @@ static void supplicant_parse_peer(struct supplicant *s,
* parse it we _definitely_ have to provide proper data. */ * parse it we _definitely_ have to provide proper data. */
r = wpas_message_dict_read(m, "wfd_dev_info", 's', &val); r = wpas_message_dict_read(m, "wfd_dev_info", 's', &val);
if (r >= 0) { if (r >= 0) {
t = strdup(val); /* remove "0x" from the start of wfd_dev_info and prepend
* subelement ID and lenght to it to make it compliant
* with the format of wfd_subelems */
char buf[19] = "000006";
t = strdup(strncmp("0x", val, 2)
? val
: strncat(buf, val + 2, sizeof(buf) - 7));
if (!t) { if (!t) {
log_vENOMEM(); log_vENOMEM();
} else { } else {