From owner-svn-src-all@FreeBSD.ORG Wed May 18 21:04:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FCFE106566B; Wed, 18 May 2011 21:04:30 +0000 (UTC) (envelope-from benl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25F328FC1B; Wed, 18 May 2011 21:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IL4Uwl008568; Wed, 18 May 2011 21:04:30 GMT (envelope-from benl@svn.freebsd.org) Received: (from benl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IL4Toc008562; Wed, 18 May 2011 21:04:29 GMT (envelope-from benl@svn.freebsd.org) Message-Id: <201105182104.p4IL4Toc008562@svn.freebsd.org> From: Ben Laurie Date: Wed, 18 May 2011 21:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222083 - in head/contrib/groff/src: devices/grohtml libs/libdriver roff/troff utils/hpftodit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 21:04:30 -0000 Author: benl Date: Wed May 18 21:04:29 2011 New Revision: 222083 URL: http://svn.freebsd.org/changeset/base/222083 Log: Fix clang warnings. Note: possible minor security issues fixed (untrusted string used as printf format string). Approved by: philip (mentor) Modified: head/contrib/groff/src/devices/grohtml/post-html.cpp head/contrib/groff/src/libs/libdriver/input.cpp head/contrib/groff/src/roff/troff/mtsm.cpp head/contrib/groff/src/roff/troff/node.cpp head/contrib/groff/src/utils/hpftodit/hpftodit.cpp Modified: head/contrib/groff/src/devices/grohtml/post-html.cpp ============================================================================== --- head/contrib/groff/src/devices/grohtml/post-html.cpp Wed May 18 21:00:27 2011 (r222082) +++ head/contrib/groff/src/devices/grohtml/post-html.cpp Wed May 18 21:04:29 2011 (r222083) @@ -1587,7 +1587,7 @@ void header_desc::write_headings (FILE * buffer += as_string(h); buffer += '\0'; - fprintf(f, buffer.contents()); + fputs(buffer.contents(), f); } else fputs(g->text_string, f); h++; Modified: head/contrib/groff/src/libs/libdriver/input.cpp ============================================================================== --- head/contrib/groff/src/libs/libdriver/input.cpp Wed May 18 21:00:27 2011 (r222082) +++ head/contrib/groff/src/libs/libdriver/input.cpp Wed May 18 21:04:29 2011 (r222083) @@ -995,7 +995,7 @@ next_command(void) inline bool odd(const int n) { - return (n & 1 == 1) ? true : false; + return ((n & 1) == 1) ? true : false; } ////////////////////////////////////////////////////////////////////// Modified: head/contrib/groff/src/roff/troff/mtsm.cpp ============================================================================== --- head/contrib/groff/src/roff/troff/mtsm.cpp Wed May 18 21:00:27 2011 (r222082) +++ head/contrib/groff/src/roff/troff/mtsm.cpp Wed May 18 21:04:29 2011 (r222083) @@ -611,14 +611,16 @@ int state_set::is_in(int_value_state i) return (intset & (1 << (int)i)) != 0; } +// Note: this used to have a bug s.t. it always tested for bit 0 (benl 18/5/11) int state_set::is_in(units_value_state u) { - return (unitsset & (1 << (int)u) != 0); + return (unitsset & (1 << (int)u)) != 0; } +// Note: this used to have a bug s.t. it always tested for bit 0 (benl 18/5/11) int state_set::is_in(string_value_state s) { - return (stringset & (1 << (int)s) != 0); + return (stringset & (1 << (int)s)) != 0; } void state_set::add(units_value_state, int n) Modified: head/contrib/groff/src/roff/troff/node.cpp ============================================================================== --- head/contrib/groff/src/roff/troff/node.cpp Wed May 18 21:00:27 2011 (r222082) +++ head/contrib/groff/src/roff/troff/node.cpp Wed May 18 21:04:29 2011 (r222083) @@ -2157,7 +2157,7 @@ void glyph_node::debug_node() if (c) fprintf(stderr, "%c", c); else - fprintf(stderr, ci->nm.contents()); + fputs(ci->nm.contents(), stderr); if (push_state) fprintf(stderr, " "); if (state) Modified: head/contrib/groff/src/utils/hpftodit/hpftodit.cpp ============================================================================== --- head/contrib/groff/src/utils/hpftodit/hpftodit.cpp Wed May 18 21:00:27 2011 (r222082) +++ head/contrib/groff/src/utils/hpftodit/hpftodit.cpp Wed May 18 21:04:29 2011 (r222083) @@ -870,9 +870,9 @@ output_charset(const int tfm_type) else if (!all_flag) continue; else if (tfm_type == MSL) - printf(hp_msl_to_ucode_name(charcode)); + fputs(hp_msl_to_ucode_name(charcode), stdout); else - printf(unicode_to_ucode_name(charcode)); + fputs(unicode_to_ucode_name(charcode), stdout); printf("\t%d,%d", scale(char_table[i].width), scale(char_table[i].ascent));