From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?Q?Jos=E9_Roberto_B=2E_de_A=2E?= Monteiro Newsgroups: gmane.emacs.devel Subject: Re: Let's tell we are using GTK+ Date: Tue, 19 Aug 2003 10:39:43 -0300 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20030819133943.GA993@milla.autsens.localnet> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1061524919 20360 80.91.224.253 (22 Aug 2003 04:01:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 22 Aug 2003 04:01:59 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Aug 22 06:01:58 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19q37e-0002fF-00 for ; Fri, 22 Aug 2003 06:01:58 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19q3Be-0003DZ-00 for ; Fri, 22 Aug 2003 06:06:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19q1o6-0000SN-6A for emacs-devel@quimby.gnus.org; Thu, 21 Aug 2003 22:37:42 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19q0yk-0003YP-8b for emacs-devel@gnu.org; Thu, 21 Aug 2003 21:44:38 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19pJGd-0004Gt-QM for emacs-devel@gnu.org; Tue, 19 Aug 2003 23:04:42 -0400 Original-Received: from [200.148.195.173] (helo=adsl-nrp8-C8B73A51.sao.terra.com.br) by monty-python.gnu.org with esmtp (Exim 4.20) id 19p6iD-0007XT-Hl for emacs-devel@gnu.org; Tue, 19 Aug 2003 09:39:49 -0400 Original-Received: from milla.autsens.localnet ([192.168.131.3] ident=mail) by adsl-nrp8-C8B73A51.sao.terra.com.br with esmtp (Exim 3.12 #1 (Debian)) id 19p6i9-00048A-00 for ; Tue, 19 Aug 2003 13:39:45 +0000 Original-Received: from betoes by milla.autsens.localnet with local (Exim 3.35 #1 (Debian)) id 19p6i7-0000KC-00 for ; Tue, 19 Aug 2003 10:39:43 -0300 Original-To: emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16050 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16050 On Tue, Aug 19, 2003 at 11:46:21AM +0200, Lute Kamstra wrote: > Terje Rosten writes: > > > * Lute Kamstra > > | > > | Maybe the GTK version should be mentioned as well. > > > > Updated patches with version information and the (annoying?) + > > sign removed. emacs-version will now display something like this: > > > > GNU Emacs 21.3.50.1 (i686-pc-linux-gnu, GTK+ 2.2.1) of 2003-08-04 on > > myhost.net > > I like it, but... > > [...] > > > + { > > + char gtk_version[8]; > > + sprintf (gtk_version, "%d.%d.%d", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, > > + GTK_MICRO_VERSION); > > + Vgtk_version_string = build_string (gtk_version); > > + } > > this seems vulnerable to a buffer overflow. It is acceptable to use > snprintf instead, or isn't that portable enough? (I'm not really > intimate with C.) What could be used instead, a larger string? I believe, asprintf would be better, but I don't know about portability... { char * gtk_version; asprintf (>k_version, "%d.%d.%d", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); Vgtk_version_string = build_string (gtk_version); free(gtk_version); }