X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Fvcard.c;h=f52bb29c49f5ba14ac66b93734ee82545396eb05;hb=954e5749b5e0102f8598fcc19fc10267f31a6cda;hp=5223da6b7c95a6b599808ce7d9cfeb7a0ac6d560;hpb=56d69e5d8434e98835a2582c59b771ba69475431;p=citadel.git diff --git a/libcitadel/lib/vcard.c b/libcitadel/lib/vcard.c index 5223da6b7..f52bb29c4 100644 --- a/libcitadel/lib/vcard.c +++ b/libcitadel/lib/vcard.c @@ -2,8 +2,9 @@ * vCard implementation for Citadel * * Copyright (C) 1999-2008 by the citadel.org development team. - * This code is freely redistributable under the terms of the GNU General - * Public License. All other rights reserved. + * +// This program is open source software. Use, duplication, or disclosure +// is subject to the terms of the GNU General Public License, version 3. */ @@ -81,7 +82,7 @@ void remove_charset_attribute(char *strbuf) * propname name of new property * propvalue value of new property */ -void vcard_add_prop(struct vCard *v, char *propname, char *propvalue) { +void vcard_add_prop(struct vCard *v, const char *propname, const char *propvalue) { ++v->numprops; v->prop = realloc(v->prop, (v->numprops * sizeof(struct vCardProp)) ); @@ -126,12 +127,14 @@ struct vCard *vcard_load(char *vtext) { } v = vcard_new(); - if (v == NULL) return v; + if (v == NULL) + { + free(mycopy); + return v; + } ptr = mycopy; while (!IsEmptyStr(ptr)) { - colonpos = (-1); - nlpos = (-1); colonpos = pattern2(ptr, ":"); nlpos = pattern2(ptr, "\n");