aboutsummaryrefslogtreecommitdiffstats
path: root/libskrift_open_font_at.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-08-05 17:30:53 +0200
committerMattias Andrée <maandree@kth.se>2021-08-05 17:30:53 +0200
commit210d6ad784d55362d24a22cd7e07725a794d46cd (patch)
treed4a0359da4cc1dad27266994954b608a1ab1ff51 /libskrift_open_font_at.c
parentdemo: refuse to write image to terminal (diff)
downloadlibskrift-210d6ad784d55362d24a22cd7e07725a794d46cd.tar.gz
libskrift-210d6ad784d55362d24a22cd7e07725a794d46cd.tar.bz2
libskrift-210d6ad784d55362d24a22cd7e07725a794d46cd.tar.xz
minor fixes and cleanups, and update to use new version of libgrapheme and add text length parameter instead of using NUL-termination
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libskrift_open_font_at.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libskrift_open_font_at.c b/libskrift_open_font_at.c
index 2927dea..8745991 100644
--- a/libskrift_open_font_at.c
+++ b/libskrift_open_font_at.c
@@ -4,7 +4,7 @@
int
libskrift_open_font_at(LIBSKRIFT_FONT **fontp, int dirfd, const char *path)
{
- int fd, ret;
+ int fd, ret, saved_errno;
if (!*path) {
return libskrift_open_font_fd(fontp, dirfd);
} else {
@@ -12,7 +12,9 @@ libskrift_open_font_at(LIBSKRIFT_FONT **fontp, int dirfd, const char *path)
if (fd < 0)
return -1;
ret = libskrift_open_font_fd(fontp, fd);
+ saved_errno = errno;
close(fd);
+ errno = saved_errno;
return ret;
}
}