feat: add route for adding pastes

This commit is contained in:
Jef Roosens 2022-11-21 16:22:52 +01:00
parent a22a2e5cfa
commit 7f42d540b5
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
4 changed files with 51 additions and 14 deletions

View file

@ -59,7 +59,12 @@ char entry_type_to_char(EntryType et) {
Entry *entry_new(EntryType type, const char *string) {
Entry *entry = malloc(sizeof(Entry));
entry->type = type;
entry->string = my_strdup(string);
if (string != NULL) {
entry->string = my_strdup(string);
} else {
entry->string = NULL;
}
return entry;
}