From 45856e02edf4d40dff7e8007cc31378dcccf8211 Mon Sep 17 00:00:00 2001 From: Alexander Frolov Date: Tue, 21 Feb 2012 15:04:05 +0400 Subject: [PATCH] Fixed SegFault if TERM variable is not set --- src/nyancat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nyancat.c b/src/nyancat.c index 3cbca75..46b201e 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -364,7 +364,8 @@ int main(int argc, char ** argv) { /* We are running standalone, retrieve the * terminal type from the environment. */ char * nterm = getenv("TERM"); - strcpy(term, nterm); + if (nterm) + strcpy(term, nterm); /* Also get the number of columns */ struct winsize w;