Skip to content

Commit

Permalink
vcardcomponent.c: more Windows nonsense
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmurchison committed May 7, 2024
1 parent 4d8c7f4 commit 3296884
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/libicalvcard/vcardcomponent.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,10 +1067,13 @@ static void comp_to_v3(vcardcomponent *impl)
VCARD_MEDIATYPE_PARAMETER);
if (param) {
mediatype = vcardparameter_get_mediatype(param);
if ((subtype = strchr(mediatype, '/'))) {
subtype = strchr(mediatype, '/');
if (subtype) {
/* Copy and uppercase the subtype */
char *c;

subtype = icalmemory_strdup(subtype + 1);
for (char *c = subtype; (*c = (char) toupper(*c)); c++);
for (c = subtype; (*c = (char) toupper(*c)); c++);

/* Add TYPE parameter */
vcardenumarray_element type = { .xvalue = subtype };
Expand Down Expand Up @@ -1129,13 +1132,19 @@ static void comp_to_v3(vcardcomponent *impl)
*base64 = '\0';
data = base64 + 8;
}
else if ((data = strchr(mediatype, ','))) {
*data++ = '\0';
else {
data = strchr(mediatype, ',');
if (data) {
*data++ = '\0';
}
}

if ((subtype = strchr(mediatype, '/'))) {
subtype = strchr(mediatype, '/');
if (subtype) {
/* Copy and uppercase the subtype */
for (char *c = ++subtype; (*c = (char) toupper(*c)); c++);
char *c;

for (c = ++subtype; (*c = (char) toupper(*c)); c++);

/* Add TYPE parameter */
vcardenumarray_element type = { .xvalue = subtype };
Expand Down

0 comments on commit 3296884

Please sign in to comment.