diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-02-24 13:46:54 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-02-24 13:46:54 +0000 |
commit | 89fbd7032339cc31f5c189d02050375f532bf281 (patch) | |
tree | a35fe7a2a24198f6d55f9f47e12c34ca3b5f2761 /validate.c | |
parent | ccc5179dd8a95f3867173f5e2265d6153b9d2635 (diff) | |
download | mandoc-89fbd7032339cc31f5c189d02050375f532bf281.tar.gz mandoc-89fbd7032339cc31f5c189d02050375f532bf281.tar.zst mandoc-89fbd7032339cc31f5c189d02050375f532bf281.zip |
Character-encoding checked for all text (arguments/values).
Diffstat (limited to 'validate.c')
-rw-r--r-- | validate.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: validate.c,v 1.55 2009/02/24 12:20:52 kristaps Exp $ */ +/* $Id: validate.c,v 1.56 2009/02/24 13:46:54 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se> * @@ -17,6 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ #include <assert.h> +#include <ctype.h> #include <stdlib.h> #include "private.h" @@ -396,6 +397,9 @@ check_text(struct mdoc *mdoc, size_t line, size_t pos, const char *p) size_t c; for ( ; *p; p++) { + if ( ! isprint(*p) && '\t' != *p) + return(mdoc_perr(mdoc, line, pos, + "invalid characters")); if ('\\' != *p) continue; if ((c = mdoc_isescape(p))) { @@ -403,7 +407,7 @@ check_text(struct mdoc *mdoc, size_t line, size_t pos, const char *p) continue; } return(mdoc_perr(mdoc, line, pos, - "invalid escape sequence")); + "invalid escape sequence")); } return(1); |