From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Betoes Newsgroups: gmane.emacs.devel Subject: Re: Let's tell we are using GTK+ Date: Tue, 19 Aug 2003 11:31:16 -0300 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20030819143116.GA1572@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 1061575165 10439 80.91.224.253 (22 Aug 2003 17:59:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 22 Aug 2003 17:59:25 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Aug 22 19:59:24 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 19qGC4-0002in-00 for ; Fri, 22 Aug 2003 19:59:24 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19qGGL-0002aj-00 for ; Fri, 22 Aug 2003 20:03:49 +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 19qFXf-0000XQ-A6 for emacs-devel@quimby.gnus.org; Fri, 22 Aug 2003 13:17:39 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19qAIB-0006xx-At for emacs-devel@gnu.org; Fri, 22 Aug 2003 07:41:19 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19pxkc-0005Jr-97 for emacs-devel@gnu.org; Thu, 21 Aug 2003 18:18:21 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19pv81-0005QO-FA for emacs-devel@gnu.org; Thu, 21 Aug 2003 15:29:49 -0400 Original-Received: from [200.148.195.173] (helo=adsl-nrp8-C8B73A51.sao.terra.com.br) by mx20.gnu.org with esmtp (Exim 4.20) id 19p7WA-0003OU-0M for emacs-devel@gnu.org; Tue, 19 Aug 2003 10:31:26 -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 19p7W2-0005Vz-00 for ; Tue, 19 Aug 2003 14:31:18 +0000 Original-Received: from betoes by milla.autsens.localnet with local (Exim 3.35 #1 (Debian)) id 19p7W0-0000PW-00 for ; Tue, 19 Aug 2003 11:31:16 -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:16072 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16072 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); }