From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 9 01:02:42 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 E545D106568D for ; Mon, 9 Nov 2009 01:02:42 +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 9F5B28FC15 for ; Mon, 9 Nov 2009 01:02:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id CCEA314D9ACE; Mon, 9 Nov 2009 02:02:41 +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 D3pZEA4ZNWWE; Mon, 9 Nov 2009 02:02:39 +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 4E2D514D569A; Mon, 9 Nov 2009 02:02:39 +0100 (CET) Message-ID: <4AF76A2C.400@FreeBSD.org> Date: Mon, 09 Nov 2009 02:02:36 +0100 From: Gabor Kovesdan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Alexander Best References: <4AF767FA.7040004@FreeBSD.org> In-Reply-To: <4AF767FA.7040004@FreeBSD.org> 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 01:02:43 -0000 Gabor Kovesdan escribió: > 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. And one more thing. Personally, I think that a more specific/descriptive name would be better, e.g. BURNCD_SPEED. SPEED is just too general. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org