ia64/xen-unstable

changeset 18893:628b3a76dbf4

libxc: Fix gcc 4.3 build failure

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Dec 09 12:42:18 2008 +0000 (2008-12-09)
parents 76099ad24cbd
children b1b9cf7a2d36
files tools/libxc/xc_dom_x86.c
line diff
     1.1 --- a/tools/libxc/xc_dom_x86.c	Tue Dec 09 12:41:12 2008 +0000
     1.2 +++ b/tools/libxc/xc_dom_x86.c	Tue Dec 09 12:42:18 2008 +0000
     1.3 @@ -418,7 +418,8 @@ static int start_info_x86_32(struct xc_d
     1.4      xc_dom_printf("%s: called\n", __FUNCTION__);
     1.5  
     1.6      memset(start_info, 0, sizeof(*start_info));
     1.7 -    snprintf(start_info->magic, sizeof(start_info->magic), dom->guest_type);
     1.8 +    strncpy(start_info->magic, dom->guest_type, sizeof(start_info->magic));
     1.9 +    start_info->magic[sizeof(start_info->magic) - 1] = '\0';
    1.10      start_info->nr_pages = dom->total_pages;
    1.11      start_info->shared_info = shinfo << PAGE_SHIFT_X86;
    1.12      start_info->pt_base = dom->pgtables_seg.vstart;
    1.13 @@ -457,7 +458,8 @@ static int start_info_x86_64(struct xc_d
    1.14      xc_dom_printf("%s: called\n", __FUNCTION__);
    1.15  
    1.16      memset(start_info, 0, sizeof(*start_info));
    1.17 -    snprintf(start_info->magic, sizeof(start_info->magic), dom->guest_type);
    1.18 +    strncpy(start_info->magic, dom->guest_type, sizeof(start_info->magic));
    1.19 +    start_info->magic[sizeof(start_info->magic) - 1] = '\0';
    1.20      start_info->nr_pages = dom->total_pages;
    1.21      start_info->shared_info = shinfo << PAGE_SHIFT_X86;
    1.22      start_info->pt_base = dom->pgtables_seg.vstart;