From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RvE9C-0001V4-Pe for mharc-grub-devel@gnu.org; Wed, 08 Feb 2012 15:29:46 -0500 Received: from eggs.gnu.org ([140.186.70.92]:60642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvE97-0001Ux-67 for grub-devel@gnu.org; Wed, 08 Feb 2012 15:29:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvE95-0000x0-NO for grub-devel@gnu.org; Wed, 08 Feb 2012 15:29:41 -0500 Received: from mail-wi0-f169.google.com ([209.85.212.169]:39717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvE95-0000wt-GB for grub-devel@gnu.org; Wed, 08 Feb 2012 15:29:39 -0500 Received: by wibhj13 with SMTP id hj13so898968wib.0 for ; Wed, 08 Feb 2012 12:29:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=0h0bhtjdQPoLVzmJlW6EkGM4g62cSzWQfAo2y1meY5U=; b=NwxpoAPM92EVSVaknIz5V0tP0m82QgzEDLXULU4j9WzuEvXXr3MHZdEub9PHtQ7JNK 1yAEWA6fm7l3OtKg28vzniXvV6f2hdyj3KWKl1eI/0B1HTj+9nYNiAeltyhDTOxxYA6P Feunm4CFIUD6yzsvhLEmxtYqUdXgJwUlX7uKk= Received: by 10.216.145.1 with SMTP id o1mr7456945wej.45.1328732978578; Wed, 08 Feb 2012 12:29:38 -0800 (PST) Received: from debian.x201.phnet (202-41.62-81.cust.bluewin.ch. [81.62.41.202]) by mx.google.com with ESMTPS id da8sm2317050wib.6.2012.02.08.12.29.36 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Feb 2012 12:29:37 -0800 (PST) Message-ID: <4F32DB2F.8070603@gmail.com> Date: Wed, 08 Feb 2012 21:29:35 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120104 Icedove/8.0 MIME-Version: 1.0 To: Matthew Garrett Subject: Re: [PATCH 2/4] Add grub_efi_get_variable References: <1328719918-4789-1-git-send-email-mjg@redhat.com> <1328719918-4789-3-git-send-email-mjg@redhat.com> <4F32D33B.80000@gmail.com> <20120208200434.GA7865@srcf.ucam.org> <4F32D673.2070402@gmail.com> <20120208201911.GA8098@srcf.ucam.org> In-Reply-To: <20120208201911.GA8098@srcf.ucam.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.169 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:29:45 -0000 On 08.02.2012 21:19, Matthew Garrett wrote: > On Wed, Feb 08, 2012 at 09:09:23PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: >> On 08.02.2012 21:04, Matthew Garrett wrote: >>> 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? >> It already is. The prototype and the define is in grub/charset.h > Oh, I was thinking of modules, but then this is already in core. Yes, > I'll do that. grub_utf8_to_utf16 is in normal.mod. The easiest way to fix this problem is to inline grub_utf8_to_utf16. It's used only in 2 other different places. > -- Regards Vladimir 'φ-coder/phcoder' Serbinenko