1
0
mirror of https://codeberg.org/vyivel/dulcepan/ synced 2025-12-19 16:36:48 +02:00

output: store name

This commit is contained in:
Kirill Primak
2024-06-24 16:38:02 +03:00
parent 29c6ebf48c
commit 447f2a8e5b
4 changed files with 40 additions and 11 deletions

View File

@@ -35,6 +35,14 @@ void *dp_zalloc(size_t size) {
return ptr;
}
char *dp_strdup(const char *str) {
char *ptr = strdup(str);
if (ptr == NULL) {
dp_log_fatal("Failed to duplicate %s", str);
}
return ptr;
}
const char *dp_ext_from_path(const char *path) {
size_t len = strlen(path);
for (size_t i = len; i-- > 0;) {