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: Wed, 20 Aug 2003 15:24:18 -0300 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20030820182418.GA10777@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 1061451851 24578 80.91.224.253 (21 Aug 2003 07:44:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Aug 2003 07:44:11 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Aug 21 09:44:10 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 19pk77-0005Mi-00 for ; Thu, 21 Aug 2003 09:44:09 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19pkAk-0000Hg-00 for ; Thu, 21 Aug 2003 09:47:55 +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 19pgKh-0002GO-TG for emacs-devel@quimby.gnus.org; Wed, 20 Aug 2003 23:41:55 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19pbl8-0003pY-Bi for emacs-devel@gnu.org; Wed, 20 Aug 2003 18:48:54 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19paIs-00033c-Tg for emacs-devel@gnu.org; Wed, 20 Aug 2003 17:16:10 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19pXdK-0001Ci-9k for emacs-devel@gnu.org; Wed, 20 Aug 2003 14:24:34 -0400 Original-Received: from [200.148.205.213] (helo=adsl-nrp8-C8B73A51.sao.terra.com.br) by mx20.gnu.org with esmtp (Exim 4.20) id 19pXdF-0007SJ-T0 for emacs-devel@gnu.org; Wed, 20 Aug 2003 14:24:30 -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 19pXd6-0002rx-00 for ; Wed, 20 Aug 2003 18:24:20 +0000 Original-Received: from betoes by milla.autsens.localnet with local (Exim 3.35 #1 (Debian)) id 19pXd4-0002oz-00 for ; Wed, 20 Aug 2003 15:24:18 -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:16035 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16035 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); }