diff options
author | Kevin Lange <kevin.lange@phpwnage.com> | 2012-02-21 07:18:12 -0800 |
---|---|---|
committer | Kevin Lange <kevin.lange@phpwnage.com> | 2012-02-21 07:18:12 -0800 |
commit | 0f5778a4a38fc98ec59a28657ed0926af7323bbf (patch) | |
tree | 490bad5cbe00a8eb3404f3f2ed66fb016ff4c14f /src | |
parent | 4fd7ab2ce46794bd18ea125e9c8e2d25d5fe95a7 (diff) | |
parent | 45856e02edf4d40dff7e8007cc31378dcccf8211 (diff) | |
download | nyancat-0f5778a4a38fc98ec59a28657ed0926af7323bbf.tar.gz |
Merge pull request #14 from froller/master
Fixed SegFault if TERM variable is not set
Diffstat (limited to '')
-rw-r--r-- | src/nyancat.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |