diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-10 21:27:39 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-10 21:27:39 +0000 |
commit | 3a26b8088d5978b9e623c51df0dcaf7206eae3e4 (patch) | |
tree | b99a9664b17c655d124639fab9378fb6b0f575a4 /argv.c | |
parent | f3c9eab1da2779b6766d824dadb71d6cfb070509 (diff) | |
download | mandoc-3a26b8088d5978b9e623c51df0dcaf7206eae3e4.tar.gz |
Made sure saved value is initialised.
Diffstat (limited to 'argv.c')
-rw-r--r-- | argv.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -253,9 +253,11 @@ mdoc_argv(struct mdoc *mdoc, int line, int tok, /* * XXX: save the nullified byte as we'll restore it if this - * doesn't end up being a command after all. + * doesn't end up being a command after all. This is a little + * bit hacky. I don't like it, but it works for now. */ + sv = 0; if (buf[*pos]) { sv = buf[*pos]; buf[(*pos)++] = 0; @@ -272,8 +274,9 @@ mdoc_argv(struct mdoc *mdoc, int line, int tok, */ if (MDOC_ARG_MAX == (tmp.arg = argv_a2arg(tok, p))) { - /* Restore saved byte. */ - buf[*pos - 1] = sv; + /* XXX - restore saved byte. */ + if (sv) + buf[*pos - 1] = sv; if ( ! pwarn(mdoc, line, i, WARGVPARM)) return(ARGV_ERROR); return(ARGV_WORD); |