[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/22] target-i386: use pstrcpy, not strncpy
From: |
Jim Meyering |
Subject: |
[Qemu-devel] [PATCH 15/22] target-i386: use pstrcpy, not strncpy |
Date: |
Wed, 9 May 2012 11:23:59 +0200 |
From: Jim Meyering <address@hidden>
Use pstrcpy rather than strncpy in one more case
(in cpudef_setfield). This makes our handling of ->model_id
consistent with another pstrcpy-vs-model_id use below.
Signed-off-by: Jim Meyering <address@hidden>
---
target-i386/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 65d9af6..f810389 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1266,7 +1266,7 @@ static int cpudef_setfield(const char *name, const char
*str, void *opaque)
g_free((void *)def->name);
def->name = g_strdup(str);
} else if (!strcmp(name, "model_id")) {
- strncpy(def->model_id, str, sizeof (def->model_id));
+ pstrcpy(def->model_id, sizeof(def->model_id), str);
} else if (!strcmp(name, "level")) {
setscalar(&def->level, str, &err)
} else if (!strcmp(name, "vendor")) {
--
1.7.10.1.487.ga3935e6
- [Qemu-devel] [PATCH 18/22] acpi: remove strzcpy (strncpy-identical) function; just use strncpy, (continued)
- [Qemu-devel] [PATCH 22/22] doc: update HACKING wrt strncpy/pstrcpy, Jim Meyering, 2012/05/09
- [Qemu-devel] [PATCH 11/22] virtio-9p: avoid unwarranted uses of strncpy, Jim Meyering, 2012/05/09
- [Qemu-devel] [PATCH 17/22] libcacard/vcard_emul_nss: use pstrcpy in place of strncpy, Jim Meyering, 2012/05/09
- [Qemu-devel] [PATCH 16/22] qemu-ga: prefer pstrcpy: consistently NUL-terminate ifreq.ifr_name, Jim Meyering, 2012/05/09
- [Qemu-devel] [PATCH 15/22] target-i386: use pstrcpy, not strncpy,
Jim Meyering <=
- [Qemu-devel] [PATCH 07/22] ppc: avoid buffer overrun: use pstrcpy, not strncpy, Jim Meyering, 2012/05/09
- [Qemu-devel] [PATCH 02/22] sheepdog: avoid a few buffer overruns, Jim Meyering, 2012/05/09
- [Qemu-devel] [PATCH 14/22] vscsi: avoid unwarranted strncpy, Jim Meyering, 2012/05/09
- [Qemu-devel] [PATCH 20/22] hw/r2d: add comment: this strncpy use is ok, Jim Meyering, 2012/05/09
- [Qemu-devel] [PATCH 04/22] hw/9pfs: avoid buffer overrun, Jim Meyering, 2012/05/09
- [Qemu-devel] [PATCH 08/22] linux-user: remove two unchecked uses of strdup, Jim Meyering, 2012/05/09