From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBLeN-0005Y1-6u for qemu-devel@nongnu.org; Wed, 05 Oct 2011 03:12:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBLeL-0005N6-E8 for qemu-devel@nongnu.org; Wed, 05 Oct 2011 03:12:19 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:40277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBLeL-0005Je-9F for qemu-devel@nongnu.org; Wed, 05 Oct 2011 03:12:17 -0400 Received: by mail-wy0-f173.google.com with SMTP id 22so1502868wyh.4 for ; Wed, 05 Oct 2011 00:12:17 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 5 Oct 2011 09:12:07 +0200 Message-Id: <1317798728-28938-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1317798728-28938-1-git-send-email-pbonzini@redhat.com> References: <1317798728-28938-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 5/6] vvfat: do not hardcode sector counts in error message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Paolo Bonzini --- block/vvfat.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index a682eae..fb3d62e 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -930,11 +930,8 @@ static int init_directories(BDRVVVFATState* s, cluster = mapping->end; if(cluster > s->cluster_count) { - fprintf(stderr,"Directory does not fit in FAT%d (capacity %s)\n", - s->fat_type, - s->fat_type == 12 ? s->sector_count == 2880 ? "1.44 MB" - : "2.88 MB" - : "504MB"); + fprintf(stderr,"Directory does not fit in FAT%d (capacity %.2f MB)\n", + s->fat_type, s->sector_count / 2000.0); return -EINVAL; } -- 1.7.6