From: Ben Pfaff Date: Sat, 9 Apr 2011 04:14:13 +0000 (-0700) Subject: segment: Fix uninitialized variable in segmenter_parse_comment_2__(). X-Git-Tag: v0.7.8~82 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95a5547f4e99d58f09395172448cb944ac3a23f0;p=pspp-builds.git segment: Fix uninitialized variable in segmenter_parse_comment_2__(). This caused a couple of test failures on Mac OS X. Thanks to Jeremy Lavergne for reporting the problem. --- diff --git a/src/language/lexer/segment.c b/src/language/lexer/segment.c index 9900cd7e..0d832579 100644 --- a/src/language/lexer/segment.c +++ b/src/language/lexer/segment.c @@ -425,7 +425,7 @@ segmenter_parse_comment_2__ (struct segmenter *s, const char *input, size_t n, return -1; if (uc == '+' || uc == '-' || uc == '.') - new_cmd = 1; + new_cmd = true; else if (!lex_uc_is_space (uc)) switch (s->mode) { @@ -442,7 +442,12 @@ segmenter_parse_comment_2__ (struct segmenter *s, const char *input, size_t n, if (new_cmd < 0) return -1; break; + + default: + NOT_REACHED (); } + else + new_cmd = false; if (new_cmd) {