common: Keep null/zero-len entries out of the IEEE1284 dictionary.

This commit is contained in:
Solomon Peachy 2024-04-05 10:29:40 -04:00
parent 6c0efde77c
commit 484c53fa1a
1 changed files with 3 additions and 0 deletions

View File

@ -206,6 +206,9 @@ int parse1284_data(const char *device_id, struct deviceid_dict* dict)
*ptr = 0;
device_id++;
if (!strlen(key) || strlen(val))
continue;
/* Add it to the dictionary */
dict[num].key = strdup(key);
dict[num].val = strdup(val);