Official patch #2 to faces v1.3, please apply it.
Rich Burridge
richb at sunchat.oz
Wed Jan 4 13:57:02 AEST 1989
It fixes the following problems:
1/ In rec.c various routines were incorrectly allocating the length
of character string to be Malloc'ed (forget the one NULL character).
Thanks to Sheldon Laube for pointing this out.
2/ The routine that extraced the username was incorrectly working if
the From line contained both '!' and '@'.
Feed this file to Larry Walls' patch program then recompile.
Rich.
------CUT HERE------CUT HERE------
*** original/get.c Sun Dec 11 15:05:47 1988
--- get.c Wed Jan 4 14:43:41 1989
***************
*** 1,6 ****
/*LINTLIBRARY*/
#ifndef lint
! static char sccsid[] = "@(#)get.c 1.2 88/12/09" ;
#endif
/* Extraction routines used by faces.
--- 1,6 ----
/*LINTLIBRARY*/
#ifndef lint
! static char sccsid[] = "@(#)get.c 1.3 89/01/04" ;
#endif
/* Extraction routines used by faces.
***************
*** 82,88 ****
return(str6) ;
case USERNAME : if ((ptr2 = rindex(str2,'!')) != NULL)
! return(ptr2+1) ;
else if ((ptr2 = index(str2,'@')) != NULL)
{
ptr1 = str2 ;
--- 82,91 ----
return(str6) ;
case USERNAME : if ((ptr2 = rindex(str2,'!')) != NULL)
! {
! if (ptr1 = index(ptr2,'@')) *ptr1 = '\0' ;
! return(ptr2+1) ;
! }
else if ((ptr2 = index(str2,'@')) != NULL)
{
ptr1 = str2 ;
*** original/patchlevel.h Wed Dec 28 15:43:15 1988
--- patchlevel.h Wed Jan 4 14:43:42 1989
***************
*** 1,5 ****
! /* @(#)patchlevel.h 1.2 88/12/28
*
* This is the current patch level for this version of faces.
*
--- 1,5 ----
! /* @(#)patchlevel.h 1.3 89/01/04
*
* This is the current patch level for this version of faces.
*
***************
*** 14,17 ****
* reported to me then an attempt will be made to fix them.
*/
! #define PATCHLEVEL 1
--- 14,17 ----
* reported to me then an attempt will be made to fix them.
*/
! #define PATCHLEVEL 2
*** original/rec.c Wed Dec 28 15:43:16 1988
--- rec.c Wed Jan 4 14:43:41 1989
***************
*** 1,6 ****
/*LINTLIBRARY*/
#ifndef lint
! static char sccsid[] = "@(#)rec.c 1.3 88/12/28" ;
#endif
/* Record handling routines used by the faces program.
--- 1,6 ----
/*LINTLIBRARY*/
#ifndef lint
! static char sccsid[] = "@(#)rec.c 1.4 89/01/04" ;
#endif
/* Record handling routines used by the faces program.
***************
*** 38,46 ****
struct peopinfo *cptemp, *ptemp ;
ptemp = (struct peopinfo *) Malloc(sizeof(struct peopinfo)) ;
! ptemp->alias = (char *) Malloc(strlen(alias)) ;
STRCPY(ptemp->alias, alias) ;
! ptemp->username = (char *) Malloc(strlen(username)) ;
STRCPY(ptemp->username, username) ;
ptemp->next = NULL ;
--- 38,46 ----
struct peopinfo *cptemp, *ptemp ;
ptemp = (struct peopinfo *) Malloc(sizeof(struct peopinfo)) ;
! ptemp->alias = (char *) Malloc(strlen(alias)+1) ;
STRCPY(ptemp->alias, alias) ;
! ptemp->username = (char *) Malloc(strlen(username)+1) ;
STRCPY(ptemp->username, username) ;
ptemp->next = NULL ;
***************
*** 65,73 ****
struct machinfo *temp ;
temp = (struct machinfo *) Malloc(sizeof(struct machinfo)) ;
! temp->machine = (char *) Malloc(strlen(machine)) ;
STRCPY(temp->machine, machine) ;
! temp->community = (char *) Malloc(strlen(community)) ;
STRCPY(temp->community, community) ;
temp->next = NULL ;
--- 65,73 ----
struct machinfo *temp ;
temp = (struct machinfo *) Malloc(sizeof(struct machinfo)) ;
! temp->machine = (char *) Malloc(strlen(machine)+1) ;
STRCPY(temp->machine, machine) ;
! temp->community = (char *) Malloc(strlen(community)+1) ;
STRCPY(temp->community, community) ;
temp->next = NULL ;
***************
*** 87,93 ****
struct psinfo *temp ;
temp = (struct psinfo *) Malloc(sizeof(struct psinfo)) ;
! temp->name = (char *) Malloc(strlen(name)) ;
STRCPY(temp->name, name) ;
temp->row = row ;
temp->column = column ;
--- 87,93 ----
struct psinfo *temp ;
temp = (struct psinfo *) Malloc(sizeof(struct psinfo)) ;
! temp->name = (char *) Malloc(strlen(name)+1) ;
STRCPY(temp->name, name) ;
temp->row = row ;
temp->column = column ;
***************
*** 109,119 ****
struct recinfo *temp ;
temp = (struct recinfo *) Malloc(sizeof(struct recinfo)) ;
! temp->community = (char *) Malloc(strlen(community)) ;
STRCPY(temp->community, community) ;
! temp->username = (char *) Malloc(strlen(username)) ;
STRCPY(temp->username, username) ;
! temp->iconname = (char *) Malloc(strlen(iconname)) ;
STRCPY(temp->iconname, iconname) ;
STRCPY(temp->ts, timestamp) ;
temp->size = size ;
--- 109,119 ----
struct recinfo *temp ;
temp = (struct recinfo *) Malloc(sizeof(struct recinfo)) ;
! temp->community = (char *) Malloc(strlen(community)+1) ;
STRCPY(temp->community, community) ;
! temp->username = (char *) Malloc(strlen(username)+1) ;
STRCPY(temp->username, username) ;
! temp->iconname = (char *) Malloc(strlen(iconname)+1) ;
STRCPY(temp->iconname, iconname) ;
STRCPY(temp->ts, timestamp) ;
temp->size = size ;
***************
*** 144,150 ****
else ctemp = ctemp->next ;
ctemp = (struct comminfo *) Malloc(sizeof(struct comminfo)) ;
! ctemp->community = (char *) Malloc(strlen(hostname)) ;
STRCPY(ctemp->community, hostname) ;
ctemp->people = NULL ;
ctemp->next = NULL ;
--- 144,150 ----
else ctemp = ctemp->next ;
ctemp = (struct comminfo *) Malloc(sizeof(struct comminfo)) ;
! ctemp->community = (char *) Malloc(strlen(hostname)+1) ;
STRCPY(ctemp->community, hostname) ;
ctemp->people = NULL ;
ctemp->next = NULL ;
More information about the Comp.sources.bugs
mailing list