From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RvDvd-0006jk-1S for mharc-grub-devel@gnu.org; Wed, 08 Feb 2012 15:15:45 -0500 Received: from eggs.gnu.org ([140.186.70.92]:59270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvDvX-0006id-UT for grub-devel@gnu.org; Wed, 08 Feb 2012 15:15:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvDl1-0004Ar-AD for grub-devel@gnu.org; Wed, 08 Feb 2012 15:05:19 -0500 Received: from cavan.codon.org.uk ([93.93.128.6]:55746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvDky-00048U-6D for grub-devel@gnu.org; Wed, 08 Feb 2012 15:04:44 -0500 Received: from mjg59 by cavan.codon.org.uk with local (Exim 4.72) (envelope-from ) id 1RvDko-00023L-QZ; Wed, 08 Feb 2012 20:04:35 +0000 Date: Wed, 8 Feb 2012 20:04:34 +0000 From: Matthew Garrett To: Vladimir =?utf-8?Q?'=CF=86-coder=2Fphcoder'?= Serbinenko Subject: Re: [PATCH 2/4] Add grub_efi_get_variable Message-ID: <20120208200434.GA7865@srcf.ucam.org> References: <1328719918-4789-1-git-send-email-mjg@redhat.com> <1328719918-4789-3-git-send-email-mjg@redhat.com> <4F32D33B.80000@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4F32D33B.80000@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: mjg59@cavan.codon.org.uk X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 93.93.128.6 Cc: The development of GNU GRUB 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: Wed, 08 Feb 2012 20:15:43 -0000 On Wed, Feb 08, 2012 at 08:55:39PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > >+ for (i=0; i<(int)grub_strlen((char *)var); i++) > >+ var16[i] = var[i]; > >+ var16[i] = '\0'; > >+ > We use grub_utf8_to_utf16. Also don't forget to multiply the malloc > length by GRUB_MAX_UTF16_PER_UTF8 ((GRUB_MAX_UTF16_PER_UTF8 * length > + 1) * sizeof (var16[0])) That's not currently exported. Any problem with changing that? -- Matthew Garrett | mjg59@srcf.ucam.org