diff options
author | Igor Mammedov <imammedo@redhat.com> | 2012-10-22 17:03:10 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-12-06 09:17:06 +0100 |
commit | 9df694eeb8447ae5a302b4d40df9a8b91dfc61da (patch) | |
tree | f9f2b0ea479b6797b178b07aade0b63fe1129256 /target-i386/cpu.c | |
parent | 8f961357d06a0beeb7d3efbde1d754d82ff6a300 (diff) |
target-i386: Use define for cpuid vendor string size
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r-- | target-i386/cpu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 7877df174e..a631ae9c87 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1106,13 +1106,13 @@ static char *x86_cpuid_get_vendor(Object *obj, Error **errp) char *value; int i; - value = (char *)g_malloc(12 + 1); + value = (char *)g_malloc(CPUID_VENDOR_SZ + 1); for (i = 0; i < 4; i++) { value[i ] = env->cpuid_vendor1 >> (8 * i); value[i + 4] = env->cpuid_vendor2 >> (8 * i); value[i + 8] = env->cpuid_vendor3 >> (8 * i); } - value[12] = '\0'; + value[CPUID_VENDOR_SZ] = '\0'; return value; } @@ -1123,7 +1123,7 @@ static void x86_cpuid_set_vendor(Object *obj, const char *value, CPUX86State *env = &cpu->env; int i; - if (strlen(value) != 12) { + if (strlen(value) != CPUID_VENDOR_SZ) { error_set(errp, QERR_PROPERTY_VALUE_BAD, "", "vendor", value); return; |