fix mkevent.c

This commit is contained in:
Liam Waldron 2023-04-14 10:45:10 -04:00
parent 3d311eac5b
commit a41f009257

View File

@ -15,6 +15,14 @@ char mkevent(int argc, char *argv[]) {
printf("ensure the events file defined in config.h exists\n" COL_RESET TXT_RESET);
exit(1);
}
if (argc < 2) {
printf(TXT_BOLD COL_RED "not enough arguments\n" COL_RESET TXT_RESET);
return 1
}
printf("creating event on date %s", argv[2]);
printf("with name %s", argv[3]);
fprintf(fp, "BEGIN ENTRY\n");
fprintf(fp, "%s", argv[2]); /* print date */
fprintf(fp, "%s", argv[3]); /* print name */