[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 09/12] VMDK: open/read/write for monolithicFl
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v5 09/12] VMDK: open/read/write for monolithicFlat image |
Date: |
Thu, 30 Jun 2011 07:13:22 +0100 |
On Thu, Jun 30, 2011 at 2:57 AM, Fam Zheng <address@hidden> wrote:
> On Wed, Jun 29, 2011 at 11:57 PM, Stefan Hajnoczi <address@hidden> wrote:
>> On Tue, Jun 28, 2011 at 2:32 AM, Fam Zheng <address@hidden> wrote:
>>> + /* trim the quotation marks around */
>>> + if (fname[0] == '"') {
>>> + memmove(fname, fname + 1, strlen(fname) + 1);
>>
>> This copies 1 byte too many, just strlen(fname) will do.
> I meant to copy the NULL terminator too.
Yes. The problem is the copying starts at fname + 1 but strlen(3)
starts at fname. So there is already an extra byte. The + 1 adds an
additional byte after the NUL.
Stefan
- [Qemu-devel] [PATCH v5 01/12] VMDK: introduce VmdkExtent, (continued)
- [Qemu-devel] [PATCH v5 01/12] VMDK: introduce VmdkExtent, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 02/12] VMDK: bugfix, align offset to cluster in get_whole_cluster, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 03/12] VMDK: probe for monolithicFlat images, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 04/12] VMDK: separate vmdk_open by format version, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 05/12] VMDK: add field BDRVVmdkState.desc_offset, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 06/12] VMDK: flush multiple extents, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 07/12] VMDK: move 'static' cid_update flag to bs field, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 09/12] VMDK: open/read/write for monolithicFlat image, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 08/12] VMDK: change get_cluster_offset return type, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 11/12] VMDK: fix coding style, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 10/12] VMDK: create different subformats, Fam Zheng, 2011/06/27
- [Qemu-devel] [PATCH v5 12/12] BlockDriver: add bdrv_get_allocated_file_size() operation, Fam Zheng, 2011/06/27