From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,fb0932f954bf7909 X-Google-Attributes: gidfee84,public From: reeves@ayauw.zk3.dec.com (Jon Reeves) Subject: Re: Segmentation Violation Date: 1996/11/07 Message-ID: <55t41k$650@lead.zk3.dec.com>#1/1 X-Deja-AN: 195107165 references: <55qg8v$tdi@pulp.ucs.ualberta.ca> organization: UNIX Software Group reply-to: reeves@zk3.dec.com newsgroups: comp.unix.osf.osf1 In article <55qg8v$tdi@pulp.ucs.ualberta.ca>, nbehzad@ee.ualberta.ca (Nader Behzad) writes: ... |> tempstring = (char *)Malloc(256*sizeof(char)); ... |> i = (char_count - strlen(tempstring)); /* <-------- A */ ... |> "tempstring" is NULL and this causes the program to crash at point A. The strlen function is only defined on pointers to strings. NULL is not a pointer to a string. -- Jon Reeves Digital UNIX Software Group reeves@zk3.dec.com