]> code.citadel.org Git - citadel.git/commitdiff
vcard.c update
authorArt Cancro <ajc@citadel.org>
Fri, 17 Mar 2006 04:37:02 +0000 (04:37 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 17 Mar 2006 04:37:02 +0000 (04:37 +0000)
citadel/vcard.c

index 52890a461d7f52affea2e64a0fe6a29f8a08e664..140766ea99a74fdd53ced72fafb331df6d02246f 100644 (file)
@@ -39,6 +39,9 @@
 #include "tools.h"
 
 
+
+
+
 /** 
  * \brief Constructor (empty vCard)
  * \return an empty vcard
@@ -312,9 +315,9 @@ char *vcard_serialize(struct vCard *v)
 
        safestrncpy(ser, "begin:vcard\r\n", len);
        if (v->numprops) for (i=0; i<(v->numprops); ++i) {
-               if (strcasecmp(v->prop[i].name, "end")) {
+               if ( (strcasecmp(v->prop[i].name, "end")) && (v->prop[i].value != NULL) ) {
                        is_utf8 = 0;
-                       for (j=0; i<strlen(v->prop[i].value); ++i) {
+                       for (j=0; j<strlen(v->prop[i].value); ++j) {
                                if ( (v->prop[i].value[j] < 32) || (v->prop[i].value[j] > 126) ) {
                                        is_utf8 = 1;
                                }
@@ -396,3 +399,4 @@ void vcard_fn_to_n(char *vname, char *n, size_t vname_size) {
 
 
 
+