From ahmetov@rain.ifmo.ru  Wed Aug 20 05:43:06 2003
Return-Path: <ahmetov@rain.ifmo.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3291416A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Aug 2003 05:43:06 -0700 (PDT)
Received: from aps.mark-itt.ru (aps.mark-itt.ru [217.14.192.43])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6247143FE0
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Aug 2003 05:43:03 -0700 (PDT)
	(envelope-from ahmetov@rain.ifmo.ru)
Received: from [217.14.193.194] (HELO localhost.my.domain)
  by aps.mark-itt.ru (CommuniGate Pro SMTP 4.0.6)
  with ESMTP-TLS id 56137332 for FreeBSD-gnats-submit@freebsd.org; Wed, 20 Aug 2003 17:42:48 +0500
Received: from igor by localhost.my.domain with local (Exim 4.20)
	id 124EDE-0000de-VA
	for FreeBSD-gnats-submit@freebsd.org; Sat, 01 Jan 2000 05:24:12 +0300
Message-Id: <E124EDE-0000de-VA@localhost.my.domain>
Date: Sat, 01 Jan 2000 05:24:12 +0300
From: Igor Ahmetov <ahmetov@rain.ifmo.ru>
Sender: Igor Ahmetov <igor@localhost.my.domain>
Reply-To: Igor Ahmetov <ahmetov@rain.ifmo.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: a little correction to the arch-handbook
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         55805
>Category:       docs
>Synopsis:       a little correction to the arch-handbook
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 20 05:50:18 PDT 2003
>Closed-Date:    Wed Sep 24 19:06:05 PDT 2003
>Last-Modified:  Wed Sep 24 19:06:05 PDT 2003
>Originator:     Igor Ahmetov
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD localhost.my.domain 5.1-CURRENT FreeBSD 5.1-CURRENT #4: Mon Aug 18 22:25:50 MSD 2003 root@localhost.my.domain:/usr/obj/usr/src/sys/CUSTOM i386
>Description:
Looking into the example in section 13.4 of the arch-handbook (driverbasics/chapter.sgml),
we see a declaration: 
	typedef struct s_echo {
		char msg[BUFFERSIZE];
	      	int len;
	} t_echo;
	
And later, in function echo_write, the following statement:
	*(echomsg->msg + MIN(uio->uio_iov->iov_len,BUFFERSIZE)) = 0; 

So isn't it more correct to declare member msg of struct s_echo as char msg[BUFFERSIZE + 1]?
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:

From: Rui Lopes <rui@ruilopes.com>
To: Igor Ahmetov <ahmetov@rain.ifmo.ru>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: docs/55805: a little correction to the arch-handbook
Date: 25 Aug 2003 01:22:39 +0100

 On S?, 2000-01-01 at 02:24, Igor Ahmetov wrote:
 [...]
 > >Description:
 > Looking into the example in section 13.4 of the arch-handbook (driverbasics/chapter.sgml),
 > we see a declaration: 
 > 	typedef struct s_echo {
 > 		char msg[BUFFERSIZE];
 > 	      	int len;
 > 	} t_echo;
 > 	
 > And later, in function echo_write, the following statement:
 > 	*(echomsg->msg + MIN(uio->uio_iov->iov_len,BUFFERSIZE)) = 0; 
 > 
 > So isn't it more correct to declare member msg of struct s_echo as char msg[BUFFERSIZE + 1]?
 
 Take a look at:
 http://www.freebsd.org/cgi/query-pr.cgi?pr=docs/55445
 
State-Changed-From-To: open->closed 
State-Changed-By: hmp 
State-Changed-When: Wed Sep 24 19:05:47 PDT 2003 
State-Changed-Why:  
Same problem as: PR/55445 


http://www.freebsd.org/cgi/query-pr.cgi?pr=55805 
>Unformatted:
