From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOzpl-0007Uj-WA for qemu-devel@nongnu.org; Thu, 09 Jul 2009 16:03:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOzpg-0007L5-Rx for qemu-devel@nongnu.org; Thu, 09 Jul 2009 16:03:09 -0400 Received: from [199.232.76.173] (port=55988 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOzpg-0007Km-KT for qemu-devel@nongnu.org; Thu, 09 Jul 2009 16:03:04 -0400 Received: from rv-out-0708.google.com ([209.85.198.243]:22665) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOzpg-0006ra-3O for qemu-devel@nongnu.org; Thu, 09 Jul 2009 16:03:04 -0400 Received: by rv-out-0708.google.com with SMTP id b17so85249rvf.22 for ; Thu, 09 Jul 2009 13:03:03 -0700 (PDT) Message-ID: <4A564CF3.2040005@codemonkey.ws> Date: Thu, 09 Jul 2009 15:02:59 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-io: small cleanups for the aio code References: <20090701112018.GA10455@lst.de> In-Reply-To: <20090701112018.GA10455@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org Christoph Hellwig wrote: > if (ctx->Pflag) { > - void *cmp_buf = malloc(total); > + void *cmp_buf = malloc(ctx->qiov.size); > > - memset(cmp_buf, ctx->pattern, total); > - if (memcmp(ctx->buf, cmp_buf, total)) { > + memset(cmp_buf, ctx->pattern, ctx->qiov.size); > + if (memcmp(ctx->buf, cmp_buf, ctx->qiov.size)) { > printf("Pattern verification failed at offset %lld, " > "%d bytes\n", > - (long long) ctx->offset, total); > + (long long) ctx->offset, ctx->qiov.size); > This breaks the build because ctx->qiov.size is a size_t and your format parameter is a %d. Regards, Anthony Liguori