aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 61814709..59453bca 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -32,7 +32,7 @@ static const Syntax syntaxes[] = {
{"ntriples", ".nt", SERD_NTRIPLES},
{"nquads", ".nq", SERD_NQUADS},
{"trig", ".trig", SERD_TRIG},
- {NULL, NULL, (SerdSyntax)0},
+ {NULL, NULL, SERD_SYNTAX_EMPTY},
};
SerdSyntax
@@ -43,7 +43,7 @@ serd_syntax_by_name(const char* const name)
return s->syntax;
}
}
- return (SerdSyntax)0;
+ return SERD_SYNTAX_EMPTY;
}
SerdSyntax
@@ -52,12 +52,12 @@ serd_guess_syntax(const char* const filename)
const char* ext = strrchr(filename, '.');
if (ext) {
for (const Syntax* s = syntaxes; s->name; ++s) {
- if (!serd_strncasecmp(s->extension, ext, strlen(ext))) {
+ if (s->extension && !serd_strncasecmp(s->extension, ext, strlen(ext))) {
return s->syntax;
}
}
}
- return (SerdSyntax)0;
+ return SERD_SYNTAX_EMPTY;
}
bool