Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!rosevax!rose3!starfire!merlyn From: merlyn@starfire.UUCP (Brian Westley) Newsgroups: comp.sources.bugs Subject: Nethack bug in termcap.c Message-ID: <152@starfire.UUCP> Date: Fri, 21-Aug-87 09:32:23 EDT Article-I.D.: starfire.152 Posted: Fri Aug 21 09:32:23 1987 Date-Received: Sun, 23-Aug-87 08:25:32 EDT Organization: Starfire Consultings Services, Mpls., MN Lines: 13 Keywords: Who wrote this ugly code? The code in termcap.c that copies the standout strings into new strings (without the leading nulls) isn't alloc'ing enough space. Change the following two lines: HI = (char *) alloc(strlen(SO)); HE = (char *) alloc(strlen(SE)); To this, to allow room for a terminating null: HI = (char *) alloc(strlen(SO)+1); HE = (char *) alloc(strlen(SE)+1); Merlyn Leroy