From owner-freebsd-audit Sun Oct 8 6:54:14 2000 Delivered-To: freebsd-audit@freebsd.org Received: from green.dyndns.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 545F537B503; Sun, 8 Oct 2000 06:54:11 -0700 (PDT) Received: from localhost (9bac3t@localhost [127.0.0.1] (may be forged)) by green.dyndns.org (8.11.0/8.11.0) with ESMTP id e98Ds8511931; Sun, 8 Oct 2000 09:54:09 -0400 (EDT) (envelope-from green@FreeBSD.org) Message-Id: <200010081354.e98Ds8511931@green.dyndns.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: Kris Kennaway Cc: audit@FreeBSD.org Subject: Re: isdnd cleanup In-Reply-To: Message from Kris Kennaway of "Sun, 08 Oct 2000 00:05:59 PDT." <20001008000559.A18475@citusc17.usc.edu> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 08 Oct 2000 09:54:08 -0400 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Kris Kennaway wrote: > There were a couple of string functions I left alone, but they all > seem safe. > > Kris COLS and LINES are not really constants (stupid stupid curses), so this will break if really big terminals are used. Do you think that is worth fixing? Just change the lines to while (strlen(buffer) < COLS && strlen(buffer) < sizeof(buffer) - 1) strcat(buffer, "-"); Course, it's a stupid O(n^2) loop anyway, but it's not like you can just do buffer.concat '-' * [COLS - buffer.size, 0].max in C ;) -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message