diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-29 14:59:42 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-29 14:59:42 +0000 |
commit | a9d66ce46044f8437a39aca8967a526553ac0c6e (patch) | |
tree | 547fa39b007d124a64a35a9f1ee6a259d8b5a0da /xen/arch/x86/hvm/intercept.c | |
parent | 80777c3aae7011f0230d5b023fffeda51c4bb136 (diff) | |
download | xen-a9d66ce46044f8437a39aca8967a526553ac0c6e.tar.gz xen-a9d66ce46044f8437a39aca8967a526553ac0c6e.tar.bz2 xen-a9d66ce46044f8437a39aca8967a526553ac0c6e.zip |
Remove uses of strcpy and strncpy from common and x86 code.
Retain safe_strcpy(). It can hide the third argument to strlcpy() in
most cases.
Based on patches from Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/arch/x86/hvm/intercept.c')
-rw-r--r-- | xen/arch/x86/hvm/intercept.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c index e5c1728b7d..8b32dbce82 100644 --- a/xen/arch/x86/hvm/intercept.c +++ b/xen/arch/x86/hvm/intercept.c @@ -173,7 +173,7 @@ int hvm_register_savevm(struct domain *d, return -1; } - strlcpy(se->idstr, idstr, HVM_SE_IDSTR_LEN); + safe_strcpy(se->idstr, idstr); se->instance_id = instance_id; se->version_id = version_id; @@ -224,7 +224,7 @@ int hvm_save(struct vcpu *v, hvm_domain_context_t *h) for(se = v->domain->arch.hvm_domain.first_se; se != NULL; se = se->next) { /* ID string */ - len = strnlen(se->idstr, HVM_SE_IDSTR_LEN); + len = strnlen(se->idstr, sizeof(se->idstr)); hvm_put_8u(h, len); hvm_put_buffer(h, se->idstr, len); @@ -262,7 +262,7 @@ static HVMStateEntry *find_se(struct domain *d, const char *idstr, int instance_ HVMStateEntry *se; for(se = d->arch.hvm_domain.first_se; se != NULL; se = se->next) { - if (!strncmp(se->idstr, idstr, HVM_SE_IDSTR_LEN) && + if (!strncmp(se->idstr, idstr, sizeof(se->idstr)) && instance_id == se->instance_id){ return se; } |