|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [patch 2/3] Add support for live block copy |
Date: | Tue, 22 Feb 2011 15:16:55 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Lightning/1.0b1 Thunderbird/3.0.10 |
On 02/22/2011 11:00 AM, Marcelo Tosatti wrote:
+ +static void blkcopy_switch(BdrvCopyState *s) +{ + char src_filename[1024]; + int open_flags; + + strncpy(src_filename, s->src->filename, sizeof(src_filename)); + open_flags = s->src->open_flags;
strncpy doesn't leave a NULL terminator if it runs out of space. I don't think that's your desire here.
Regards, Anthony Liguori
[Prev in Thread] | Current Thread | [Next in Thread] |