Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!seismo!brl-adm!brl-smoke!smoke!bzs@BU-CS.BU.EDU From: bzs@BU-CS.BU.EDU (Barry Shein) Newsgroups: net.unix-wizards Subject: Minor bug in msgs.c Message-ID: <2831@brl-smoke.ARPA> Date: Wed, 6-Aug-86 15:08:48 EDT Article-I.D.: brl-smok.2831 Posted: Wed Aug 6 15:08:48 1986 Date-Received: Sat, 9-Aug-86 05:48:50 EDT Sender: news@brl-smoke.ARPA Lines: 27 [4.3bsd] DESCRIPTION: If msgs finds an out of bounds .msgsrc it warns the user and truncates it in preparation to reset it to a more sane value. Unfortunately, it calls ftruncate() on a file (.msgsrc) it just fclose'd. REPEAT-BY: Set your .msgsrc to some ridiculously high value, run msgs, get warning message, quit. Look at .msgsrc file, it will have two lines in it rather than one. FIX: Change (the only) ftruncate(fileno(msgsrc),0); to truncate(fname,0); (the code then goes on to re-open the file shortly thereafter so it can update it.) -Barry Shein, Boston University