[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Wed Sep 12 08:58:08 UTC 2012


 parted/strlist.c                     |    4 ++--
 tests/t0203-gpt-tiny-device-abort.sh |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1d67e37ef257d3d3847126f3b899b8b0e11aa186
Author: Jim Meyering <meyering at redhat.com>
Date:   Wed Sep 12 10:02:46 2012 +0200

    tests: clarify a comment: _reading_ gpt tables on tiny devices
    
    * tests/t0203-gpt-tiny-device-abort.sh: Clarify.

diff --git a/tests/t0203-gpt-tiny-device-abort.sh b/tests/t0203-gpt-tiny-device-abort.sh
index 7283c55..bf281ff 100644
--- a/tests/t0203-gpt-tiny-device-abort.sh
+++ b/tests/t0203-gpt-tiny-device-abort.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
-# parted before 3.1 could abort for a pathologically small device with
-# a valid primary GPT header but no room for the backup header.
+# parted before 3.1 could abort while reading a pathologically small device
+# with a valid primary GPT header but no room for the backup header.
 
 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
 

commit 464c0f9ae4af8346cd494c6434f4addabdd76e9d
Author: Jim Meyering <meyering at redhat.com>
Date:   Tue Sep 11 17:22:52 2012 +0200

    maint: remove unnecessary wcslen use
    
    * parted/strlist.c (gettext_to_wchar): Tighten up test for
    mbsrtowcs failure and remove unnecessary wcslen use.

diff --git a/parted/strlist.c b/parted/strlist.c
index d34fb56..1f90c0e 100644
--- a/parted/strlist.c
+++ b/parted/strlist.c
@@ -112,10 +112,10 @@ gettext_to_wchar (const char* str)
 
 	memset(&ps, 0, sizeof (ps));
 	status = mbsrtowcs(result, &str, count, &ps);
-	if (status == (size_t) -1)
+	if (str != NULL)
 		goto error;
 
-	result = xrealloc (result, (wcslen (result) + 1) * sizeof (wchar_t));
+	result = xrealloc (result, (status + 1) * sizeof (wchar_t));
 	return result;
 
 error:



More information about the Parted-commits mailing list