commit 20e5d7d345568c33258e0d242132e1450a027a1b
parent f963aa5b8a7eaaf202a16c4948aeabbecf4e0b9b
Author: Andreas Gruhler <agruhl@gmx.ch>
Date: Thu, 3 Jun 2021 00:04:48 +0200
fix PUT postfields
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/caldav.c b/caldav.c
@@ -548,10 +548,14 @@ void put_event(struct tm* date, const char* dir, size_t dir_size, char* calendar
fprintf(stderr, "PUT event postfields:\n%s\n", postfields);
- char* reponse = caldav_req(date, calendar_uri, "PUT", ics, 0);
- fprintf(stderr, "PUT event response:\n%s\n", reponse);
+ char* response = caldav_req(date, calendar_uri, "PUT", postfields, 0);
+ fprintf(stderr, "PUT event response:\n%s\n", response);
fclose(fp);
free(file_buf);
+
+ if (response == NULL) {
+ fprintf(stderr, "PUT event failed.\n");
+ }
}
void caldav_sync(struct tm* date, WINDOW* header, WINDOW* cal, int pad_pos, const char* dir, size_t dir_size) {