The contents of the TERMCAP environment variable, or of the termcap entry from the termcap database, are read into storage when the application is initializing. However, the memory buffer that is allocated to hold the termcap entry is 1,024 bytes, and the entry in use is longer than that. Use a simpler termcap.