[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxc: Fix gcc 4.3 build failure



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1228826538 0
# Node ID 628b3a76dbf40872b2d24ff6ba6ca8b13b0391df
# Parent  76099ad24cbde2d12dc74aa4edc0adefaa9f1767
libxc: Fix gcc 4.3 build failure

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
---
 tools/libxc/xc_dom_x86.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -r 76099ad24cbd -r 628b3a76dbf4 tools/libxc/xc_dom_x86.c
--- a/tools/libxc/xc_dom_x86.c  Tue Dec 09 12:41:12 2008 +0000
+++ b/tools/libxc/xc_dom_x86.c  Tue Dec 09 12:42:18 2008 +0000
@@ -418,7 +418,8 @@ static int start_info_x86_32(struct xc_d
     xc_dom_printf("%s: called\n", __FUNCTION__);
 
     memset(start_info, 0, sizeof(*start_info));
-    snprintf(start_info->magic, sizeof(start_info->magic), dom->guest_type);
+    strncpy(start_info->magic, dom->guest_type, sizeof(start_info->magic));
+    start_info->magic[sizeof(start_info->magic) - 1] = '\0';
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
@@ -457,7 +458,8 @@ static int start_info_x86_64(struct xc_d
     xc_dom_printf("%s: called\n", __FUNCTION__);
 
     memset(start_info, 0, sizeof(*start_info));
-    snprintf(start_info->magic, sizeof(start_info->magic), dom->guest_type);
+    strncpy(start_info->magic, dom->guest_type, sizeof(start_info->magic));
+    start_info->magic[sizeof(start_info->magic) - 1] = '\0';
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.