Use snprintf to please OpenBSD linker

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5529 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2008-10-25 11:18:12 +00:00
parent fbc190d82a
commit 5b3715bfda
1 changed files with 9 additions and 9 deletions

View File

@ -1050,12 +1050,12 @@ const char *get_feature_xml(CPUState *env, const char *p, const char **newp)
if (!target_xml[0]) { if (!target_xml[0]) {
GDBRegisterState *r; GDBRegisterState *r;
sprintf(target_xml, snprintf(target_xml, sizeof(target_xml),
"<?xml version=\"1.0\"?>" "<?xml version=\"1.0\"?>"
"<!DOCTYPE target SYSTEM \"gdb-target.dtd\">" "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">"
"<target>" "<target>"
"<xi:include href=\"%s\"/>", "<xi:include href=\"%s\"/>",
GDB_CORE_XML); GDB_CORE_XML);
for (r = env->gdb_regs; r; r = r->next) { for (r = env->gdb_regs; r; r = r->next) {
strcat(target_xml, "<xi:include href=\""); strcat(target_xml, "<xi:include href=\"");
@ -1426,7 +1426,7 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf)
} }
#endif #endif
if (strncmp(p, "Supported", 9) == 0) { if (strncmp(p, "Supported", 9) == 0) {
sprintf(buf, "PacketSize=%x", MAX_PACKET_LENGTH); snprintf(buf, sizeof(buf), "PacketSize=%x", MAX_PACKET_LENGTH);
#ifdef GDB_CORE_XML #ifdef GDB_CORE_XML
strcat(buf, ";qXfer:features:read+"); strcat(buf, ";qXfer:features:read+");
#endif #endif
@ -1442,7 +1442,7 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf)
p += 19; p += 19;
xml = get_feature_xml(env, p, &p); xml = get_feature_xml(env, p, &p);
if (!xml) { if (!xml) {
sprintf(buf, "E00"); snprintf(buf, sizeof(buf), "E00");
put_packet(s, buf); put_packet(s, buf);
break; break;
} }
@ -1456,7 +1456,7 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf)
total_len = strlen(xml); total_len = strlen(xml);
if (addr > total_len) { if (addr > total_len) {
sprintf(buf, "E00"); snprintf(buf, sizeof(buf), "E00");
put_packet(s, buf); put_packet(s, buf);
break; break;
} }