diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2009-08-11 12:47:59 -0700 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-08-24 08:46:48 -0500 |
commit | 66844091dde1e68f3e5b04df7204222baf0e11de (patch) | |
tree | ebb1d82acbe9fb30a790b5fc8c5d8af497bad9e0 | |
parent | 31d5bd106854add14dcfaf0e8b30c9c1b1d0bb22 (diff) | |
download | qemu-66844091dde1e68f3e5b04df7204222baf0e11de.tar.gz qemu-66844091dde1e68f3e5b04df7204222baf0e11de.tar.bz2 qemu-66844091dde1e68f3e5b04df7204222baf0e11de.zip |
eliminate errors about unused results in block/vpc.c
These errors come up when compiling with gcc-4.3.3 and some older headers:
/scratch/froydnj/qemu.git/block/vpc.c: In function 'vpc_create':
/scratch/froydnj/qemu.git/block/vpc.c:514: error: value computed is not used
/scratch/froydnj/qemu.git/block/vpc.c:516: error: value computed is not used
/scratch/froydnj/qemu.git/block/vpc.c:517: error: value computed is not used
/scratch/froydnj/qemu.git/block/vpc.c:566: error: value computed is not used
Use memcpy to copy the strings instead of strncpy.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | block/vpc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/vpc.c b/block/vpc.c index ba482e9afb..6be24bf84e 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -511,10 +511,10 @@ static int vpc_create(const char *filename, QEMUOptionParameter *options) // Prepare the Hard Disk Footer memset(buf, 0, 1024); - strncpy(footer->creator, "conectix", 8); + memcpy(footer->creator, "conectix", 8); // TODO Check if "qemu" creator_app is ok for VPC - strncpy(footer->creator_app, "qemu", 4); - strncpy(footer->creator_os, "Wi2k", 4); + memcpy(footer->creator_app, "qemu", 4); + memcpy(footer->creator_os, "Wi2k", 4); footer->features = be32_to_cpu(0x02); footer->version = be32_to_cpu(0x00010000); @@ -563,7 +563,7 @@ static int vpc_create(const char *filename, QEMUOptionParameter *options) // Prepare the Dynamic Disk Header memset(buf, 0, 1024); - strncpy(dyndisk_header->magic, "cxsparse", 8); + memcpy(dyndisk_header->magic, "cxsparse", 8); dyndisk_header->data_offset = be64_to_cpu(0xFFFFFFFF); dyndisk_header->table_offset = be64_to_cpu(3 * 512); |