aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/blogc.c')
-rw-r--r--src/blogc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/blogc.c b/src/blogc.c
index 40a5918..4606740 100644
--- a/src/blogc.c
+++ b/src/blogc.c
@@ -30,6 +30,7 @@
#include "loader.h"
#include "renderer.h"
#include "error.h"
+#include "utf8.h"
#include "utils.h"
#ifndef PACKAGE_VERSION
@@ -125,6 +126,11 @@ main(int argc, char **argv)
sb_trie_insert(config, "BLOGC_VERSION", sb_strdup(PACKAGE_VERSION));
for (unsigned int i = 1; i < argc; i++) {
+ if (!blogc_utf8_validate((uint8_t*) argv[i], strlen(argv[i]))) {
+ fprintf(stderr, "blogc: error: command-line argument is not utf8-"
+ "encoded: %s\n", argv[i]);
+ goto cleanup;
+ }
tmp = NULL;
if (argv[i][0] == '-') {
switch (argv[i][1]) {