diff options
Diffstat (limited to 'sys/src/cmd/6l/obj.c')
| -rw-r--r-- | sys/src/cmd/6l/obj.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/src/cmd/6l/obj.c b/sys/src/cmd/6l/obj.c index 210e4ab2a..8035ae1e9 100644 --- a/sys/src/cmd/6l/obj.c +++ b/sys/src/cmd/6l/obj.c @@ -396,11 +396,9 @@ objfile(char *file) if(file[0] == '-' && file[1] == 'l') { if(debug['9']) - sprint(name, "/%s/lib/lib", thestring); + snprint(name, sizeof name, "/%s/lib/lib%s.a", thestring, file+2); else - sprint(name, "/usr/%clib/lib", thechar); - strcat(name, file+2); - strcat(name, ".a"); + snprint(name, sizeof name, "/usr/%clib/lib%s.a", thechar, file+2); file = name; } if(debug['v']) @@ -458,7 +456,7 @@ objfile(char *file) s = lookup(e+5, 0); if(s->type != SXREF) continue; - sprint(pname, "%s(%s)", file, s->name); + snprint(pname, sizeof pname, "%s(%s)", file, s->name); if(debug['v']) Bprint(&bso, "%5.2f library: %s\n", cputime(), pname); Bflush(&bso); @@ -586,17 +584,17 @@ addlib(char *obj) return; if(histfrog[0]->name[1] == '/') { - sprint(name, ""); + name[0] = 0; i = 1; } else if(histfrog[0]->name[1] == '.') { - sprint(name, "."); + snprint(name, sizeof name, "."); i = 0; } else { if(debug['9']) - sprint(name, "/%s/lib", thestring); + snprint(name, sizeof name, "/%s/lib", thestring); else - sprint(name, "/usr/%clib", thechar); + snprint(name, sizeof name, "/usr/%clib", thechar); i = 0; } @@ -1036,7 +1034,7 @@ loop: goto casdef; if(p->from.type == D_FCONST) { /* size sb 9 max */ - sprint(literal, "$%lux", ieeedtof(&p->from.ieee)); + snprint(literal, sizeof literal, "$%lux", ieeedtof(&p->from.ieee)); s = lookup(literal, 0); if(s->type == 0) { s->type = SBSS; @@ -1081,7 +1079,7 @@ loop: goto casdef; if(p->from.type == D_FCONST) { /* size sb 18 max */ - sprint(literal, "$%lux.%lux", + snprint(literal, sizeof literal, "$%lux.%lux", p->from.ieee.l, p->from.ieee.h); s = lookup(literal, 0); if(s->type == 0) { |
