aboutsummaryrefslogtreecommitdiffstats
path: root/libfonts_parse_alias_line.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-12 21:57:47 +0100
committerMattias Andrée <maandree@kth.se>2023-01-12 21:57:47 +0100
commit9a6046f51934f8c34a58583b44cd1dc0c0b0b8d6 (patch)
tree85623d6551c6bbf054fe2ce25e63b65675184990 /libfonts_parse_alias_line.c
parentm doc (diff)
downloadlibfonts-9a6046f51934f8c34a58583b44cd1dc0c0b0b8d6.tar.gz
libfonts-9a6046f51934f8c34a58583b44cd1dc0c0b0b8d6.tar.bz2
libfonts-9a6046f51934f8c34a58583b44cd1dc0c0b0b8d6.tar.xz
m + add libfonts_parse_dir_line
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libfonts_parse_alias_line.c')
-rw-r--r--libfonts_parse_alias_line.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libfonts_parse_alias_line.c b/libfonts_parse_alias_line.c
index 0496449..3e712e2 100644
--- a/libfonts_parse_alias_line.c
+++ b/libfonts_parse_alias_line.c
@@ -86,6 +86,11 @@ libfonts_parse_alias_line(enum libfonts_alias_line_type *typep, char **aliasp, c
if (namep)
*namep = NULL;
+ if (!line) {
+ errno = EINVAL;
+ goto fail;
+ }
+
while (isblank(*line))
line++;
if (!*line)
@@ -132,8 +137,9 @@ fail:
*namep = NULL;
}
ret = -1;
- while (*line && *line != '\n')
- line++;
+ if (line)
+ while (*line && *line != '\n')
+ line++;
out:
if (endp)
*endp = *(char **)(void *)&line;