From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VpEPy-0005Kp-Ft for mharc-grub-devel@gnu.org; Sat, 07 Dec 2013 04:43:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpEPr-0005K6-DU for grub-devel@gnu.org; Sat, 07 Dec 2013 04:43:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VpEPk-0002ti-GI for grub-devel@gnu.org; Sat, 07 Dec 2013 04:43:15 -0500 Received: from mail-ee0-x235.google.com ([2a00:1450:4013:c00::235]:39522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpEPk-0002qv-9b for grub-devel@gnu.org; Sat, 07 Dec 2013 04:43:08 -0500 Received: by mail-ee0-f53.google.com with SMTP id b57so685523eek.40 for ; Sat, 07 Dec 2013 01:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=VkbiwvWMNMLTwrogIB7+UoEqp0JHnoeyfo0lfAkO3G4=; b=RM02ze+mLw+RYVIosj0C7mV+8MHZpjRmlhaiyEIoM/nij5xC15FQwUi6KquZbo7Afm RGVDArCvrEiDAMhmkiIIf+s3zku380A4oSffUYzZhLkRkstPnpcIwj+56blTQwNS/uG/ Mk3HeA4ZadsxYECDy3yCdZhddHvdK3IXNl6dfQmJjkddnY4w/RZNXBw5VNbrV9OCUSZL /gXWeFF/7TYnXd8rWQUOZ5UZWosqfYAtzR3rC94rFq5NyjKzqoN8wGQMF3hqMXXbfZAz 0qLIVEFrGDrJtLXKtBlcEdTapOCMJXq83gUtIKF0XPJifHNhS2bkGzrTsWxTN9fvDDw5 9ghg== X-Received: by 10.15.75.68 with SMTP id k44mr24363394eey.57.1386409387444; Sat, 07 Dec 2013 01:43:07 -0800 (PST) Received: from [192.168.1.16] (85-188.196-178.cust.bluewin.ch. [178.196.188.85]) by mx.google.com with ESMTPSA id z42sm4655505eeo.17.2013.12.07.01.43.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Dec 2013 01:43:06 -0800 (PST) Message-ID: <52A2EDA1.7020303@gmail.com> Date: Sat, 07 Dec 2013 10:42:57 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH 2/2] second attempt to fix using grub device name as install device References: <1386405872-28362-1-git-send-email-arvidjaar@gmail.com> <1386405872-28362-2-git-send-email-arvidjaar@gmail.com> <52A2E0B0.2030608@gmail.com> <20131207134022.487abb56@opensuse.site> In-Reply-To: <20131207134022.487abb56@opensuse.site> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2MFVKFQUBIBHSBWPKBRIO" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::235 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2013 09:43:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2MFVKFQUBIBHSBWPKBRIO Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07.12.2013 10:40, Andrey Borzenkov wrote: > =D0=92 Sat, 07 Dec 2013 09:47:44 +0100 > Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0= =B8=D1=88=D0=B5=D1=82: >=20 >> On 07.12.2013 09:44, Andrey Borzenkov wrote: >>> + install_device[grub_strlen (install_device) - 1] =3D '\0'; >>> + install_drive =3D xstrdup (install_device + 1); >>> + install_device[grub_strlen (install_device) - 1] =3D ')'; >>> + } >> Bad code. You forgot that grub_strlen changes with your operations. Yo= u >> need to keep explicit pointer. >> >> >=20 > Oops. Any reason "our" gnulib is missing xstrndup? It is not the only > place where it will make things more simple and readable. >=20 xmalloc + memcpy + '\0' terminator in this case does the same, a little bit more efficiently. >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 ------enig2MFVKFQUBIBHSBWPKBRIO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlKi7akACgkQmBXlbbo5nOt4AwD+MvChCUUTyNAbCEtCk6XQBTG8 zMgVPOnw63tpRQ1LqD8BAJ5UyEToD6e2ufmEro+140k/sNLYXyMGpL8N568zkHi6 =n42G -----END PGP SIGNATURE----- ------enig2MFVKFQUBIBHSBWPKBRIO--