aboutsummaryrefslogtreecommitdiffstats
path: root/libskrift_open_font_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'libskrift_open_font_file.c')
-rw-r--r--libskrift_open_font_file.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/libskrift_open_font_file.c b/libskrift_open_font_file.c
index 2a122ef..32e69d6 100644
--- a/libskrift_open_font_file.c
+++ b/libskrift_open_font_file.c
@@ -4,15 +4,9 @@
int
libskrift_open_font_file(LIBSKRIFT_FONT **fontp, const char *path)
{
- *fontp = calloc(1, sizeof(**fontp));
- if (!*fontp)
- return -1;
- (*fontp)->refcount = 1;
- (*fontp)->font = sft_loadfile(path);
- if (!(*fontp)->font) {
- free(*fontp);
- *fontp = NULL;
+ if (!*path) {
+ errno = EINVAL;
return -1;
}
- return 0;
+ return libskrift_open_font_at(fontp, AT_FDCWD, path);
}