From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 9 00:53:22 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C8AD106568D for ; Mon, 9 Nov 2009 00:53:22 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 468468FC0A for ; Mon, 9 Nov 2009 00:53:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 7FCF014D9ACE; Mon, 9 Nov 2009 01:53:19 +0100 (CET) X-Virus-Scanned: amavisd-new at example.com Received: from server.mypc.hu ([127.0.0.1]) by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id P0LTu6IWlHUs; Mon, 9 Nov 2009 01:53:17 +0100 (CET) Received: from [192.168.1.105] (catv-89-132-179-104.catv.broadband.hu [89.132.179.104]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 3375F14D569A; Mon, 9 Nov 2009 01:53:17 +0100 (CET) Message-ID: <4AF767FA.7040004@FreeBSD.org> Date: Mon, 09 Nov 2009 01:53:14 +0100 From: Gabor Kovesdan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Alexander Best References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-hackers@FreeBSD.org Subject: Re: [patch] burncd: honour for envar SPEED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 00:53:22 -0000 Alexander Best escribió: > any thoughts on these small changes to burncd? > > - int nogap = 0, speed = 4 * 177, test_write = 0, force = 0; > + int nogap = 0, speed = 0, test_write = 0, force = 0; > int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0; > const char *dev; > > if ((dev = getenv("CDROM")) == NULL) > dev = "/dev/acd0"; > > + if ((speed = getenv("SPEED")) == NULL) > + speed = 4 * 177; > + It seems incorrect. The speed variable is of type int, while getenv returns char *. You should first assign getenv("SPEED") to a char * variable and if it isn't NULL then you should convert it to int or fall back to the default value otherwise. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org