feat: add route for adding pastes
This commit is contained in:
parent
a22a2e5cfa
commit
7f42d540b5
4 changed files with 51 additions and 14 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue