From mboxrd@z Thu Jan 1 00:00:00 1970 From: usotsuki@buric.co (Steve Nickolas) Date: Thu, 24 Jan 2013 01:34:27 -0500 (EST) Subject: [TUHS] History of strncpy In-Reply-To: <20130124060205.GQ24498@bitmover.com> References: <1301231756.AA27240@ivan.Harhan.ORG> <20130123214651.GF22559@mercury.ccil.org> <20130124060205.GQ24498@bitmover.com> Message-ID: On Wed, 23 Jan 2013, Larry McVoy wrote: > On Wed, Jan 23, 2013 at 04:46:51PM -0500, John Cowan wrote: >> Ronald Natalie scripsit: >>> Why on earth did they preserve the silly fread/fwrite size feature >>> that just multiplies the two middle args together long after it was >>> realized that portability doesn't demand making such a distinction. >> >> I like the idea: essentially it's about reading or writing an array >> of a specified type. > > As a SPARC guy (in the past), I think it may have had something to do > about alignment. > > That said, I hate the fread/fwrite interfaces. We're fixing them in > our stdio. freadn(f, buf, n). > That syntax makes sense. Though you'd prolly need a "#define fread(b,s,n,f) freadn(f,b,((s)*(n)))", right? For backward compatibility.