Path: utzoo!utgpu!attcan!uunet!husc6!rutgers!att!lzaz!bds From: bds@lzaz.ATT.COM (B.SZABLAK) Newsgroups: comp.os.minix Subject: Bugs in commands/pr.c commands/date.c lib/strncpy.c Keywords: ATARI ST and possibly IBM PC Message-ID: <259@lzaz.ATT.COM> Date: 7 Nov 88 13:24:56 GMT Organization: AT&T ISL Lincroft NJ USA Lines: 32 Following are some diffs for fixes to the sources delivered with the ATARI ST release of MINIX. They probably apply to the IBM PC releases as well: commands/date.c: 88a89 > days_per_month[1]=28; This fixes the problem with setting the date (particularly after having set it once already). commands/pr.c: 148a149,150 > int line, col; > 155a158,160 > for(line=0; line < length; line++) > for(col=0; col < columns; col++) > L_BUF(line, col) = NIL_PTR; This initializes the malloc array so that selecting the column option doesn't clobber the command. lib/strncpy.c: 13c13 < *s1 = 0; --- > while (--n >= 0) *s1++ = 0; Strncpy() was simply wrong going by the documentation at my disposal; it always null terminated the string even when the length was too short, and didn't fill the uncopied part with nulls when the length was too long.