Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

stat module prints garbage in 3.1.4



The function statmodeprint in file zsh-3.1.4/Src/Modules/stat.c
fails to terminate the string built in the "pm" variable.
The following patch fixes this.

---->8-------->8-------->8-------->8-------->8-------->8-------->8----
*** stat.c,DIST	Fri May 29 00:03:03 1998
--- stat.c	Fri Jun 12 23:09:02 1998
***************
*** 85,90 ****
--- 85,91 ----
  
  	for (i = 1; i <= 9; i++)
  	    pm[i] = (mode & *mfp++) ? modes[i] : '-';
+ 	pm[10] = '\0';
  
  	if (mode & S_ISUID)
  	    pm[3] = (mode & S_IXUSR) ? 's' : 'S';
---->8-------->8-------->8-------->8-------->8-------->8-------->8----

-- 
 Goran Larsson            hoh@xxxxxxxxxx
 I was an atheist,        http://home1.swipnet.se/%7Ew-12153/
 until I found out I was God.




Messages sorted by: Reverse Date, Date, Thread, Author