[PATCH obexd 1/2] Add check for empty string in vcard_printf_fullname

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If tag value is empty there is possibility to quickly create
empty tag without entering to rest of the logic.
Checking for empty parameter at the begining is included
basicaly in every print tag function in code - here somehow
was missing.
---
 plugins/vcard.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/plugins/vcard.c b/plugins/vcard.c
index f1d9edc..c0a33cb 100644
--- a/plugins/vcard.c
+++ b/plugins/vcard.c
@@ -392,6 +392,11 @@ static void vcard_printf_fullname(GString *vcards, uint8_t format,
 {
 	char field[LEN_MAX];
 
+	if (!text || strlen(text) == 0) {
+		vcard_printf(vcards, "FN:");
+		return;
+	}
+
 	if (select_qp_encoding(format, text, NULL)) {
 		vcard_qp_print_encoded(vcards, "FN", text, NULL);
 		return;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux