blobmsg: accept NULL attr in blobmsg_get_string()

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2014-08-03 15:00:54 +02:00
parent 6e8e6aca1d
commit 042f1a2546

View file

@ -214,6 +214,9 @@ static inline uint64_t blobmsg_get_u64(struct blob_attr *attr)
static inline char *blobmsg_get_string(struct blob_attr *attr)
{
if (!attr)
return NULL;
return (char *) blobmsg_data(attr);
}