33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
$OpenBSD: patch-gplink_lst_c,v 1.1 2004/01/30 01:01:11 naddy Exp $
|
|
--- gplink/lst.c.orig 2004-01-17 13:33:51.000000000 +1100
|
|
+++ gplink/lst.c 2004-01-26 10:51:21.000000000 +1100
|
|
@@ -78,7 +78,7 @@ lst_line(const char *format, ...)
|
|
return;
|
|
|
|
va_start(args, format);
|
|
- vsprintf(buffer, format, args);
|
|
+ vsnprintf(buffer, sizeof(buffer), format, args);
|
|
va_end(args);
|
|
|
|
fprintf(state.lst.f, "%s\n", buffer);
|
|
@@ -163,7 +163,7 @@ write_src(int last_line)
|
|
org = line->address >> state.byte_addr;
|
|
data = i_memory_get(line_section->data, org);
|
|
assert(data & MEM_USED_MASK);
|
|
- gp_disassemble(line_section->data, &org, state.class, dasmbuf);
|
|
+ gp_disassemble(line_section->data, &org, state.class, dasmbuf, sizeof(dasmbuf));
|
|
lst_line("%06lx %04x %-24s %s",
|
|
line->address,
|
|
data & 0xffff,
|
|
@@ -197,8 +197,8 @@ lst_init(void)
|
|
{
|
|
|
|
if (state.lstfile != named) {
|
|
- strcpy(state.lstfilename, state.basefilename);
|
|
- strcat(state.lstfilename, ".lst");
|
|
+ strlcpy(state.lstfilename, state.basefilename, sizeof(state.lstfilename));
|
|
+ strlcat(state.lstfilename, ".lst", sizeof(state.lstfilename));
|
|
}
|
|
|
|
if (state.lstfile == suppress) {
|