Date: Mon, 09 Nov 2009 01:53:14 +0100 From: Gabor Kovesdan <gabor@FreeBSD.org> To: Alexander Best <alexbestms@math.uni-muenster.de> Cc: freebsd-hackers@FreeBSD.org Subject: Re: [patch] burncd: honour for envar SPEED Message-ID: <4AF767FA.7040004@FreeBSD.org> In-Reply-To: <permail-2009110900474080e26a0b00002e97-a_best01@message-id.uni-muenster.de> References: <permail-2009110900474080e26a0b00002e97-a_best01@message-id.uni-muenster.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AF767FA.7040004>
