From 0c5cce9a96f713a826438b17c3ce304824439683 Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 31 Jan 1990 16:27:05 +0000 Subject: [PATCH] max filename length too short in error messages --- mach/proto/as/comm2.y | 2 +- mach/proto/as/comm4.c | 4 ++-- mach/proto/as/comm6.c | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mach/proto/as/comm2.y b/mach/proto/as/comm2.y index 3dd9675b1..30144a59c 100644 --- a/mach/proto/as/comm2.y +++ b/mach/proto/as/comm2.y @@ -125,7 +125,7 @@ program : /* empty */ { lineno++; LISTLINE(1); RELODONE;} | program '#' NUMBER STRING '\n' { lineno = $3; - if (modulename) strncpy(modulename, &stringbuf[1], 63); + if (modulename) strncpy(modulename, &stringbuf[1], STRINGMAX-1); LISTLINE(1); RELODONE; } | program error '\n' diff --git a/mach/proto/as/comm4.c b/mach/proto/as/comm4.c index ee778af77..18658b5fe 100644 --- a/mach/proto/as/comm4.c +++ b/mach/proto/as/comm4.c @@ -433,11 +433,11 @@ pass_23(n) newmodule(s) char *s; { - static char nmbuf[64]; + static char nmbuf[STRINGMAX]; switchsect(S_UND); if (s && s != modulename) { - strncpy(nmbuf, s, 63); + strncpy(nmbuf, s, STRINGMAX-1); modulename = nmbuf; } else modulename = s; diff --git a/mach/proto/as/comm6.c b/mach/proto/as/comm6.c index cb2a647f1..48ab4eb10 100644 --- a/mach/proto/as/comm6.c +++ b/mach/proto/as/comm6.c @@ -270,7 +270,11 @@ short s; s &= ~S_COM; if ((n & RELPC) == 0 && s == S_ABS) return; - if ((n & RELPC) != 0 && s == DOTTYP) + if ((n & RELPC) != 0 && s == DOTTYP +#ifndef ASLD + && ! iscomm +#endif + ) return; if (pass != PASS_3) { outhead.oh_nrelo++; -- 2.34.1