Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 1998 22:38:16 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        "Justin T. Gibbs" <gibbs@narnia.plutotech.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: snprintf() in the kernel
Message-ID:  <199811210638.WAA21040@apollo.backplane.com>
References:   <199811210625.XAA05877@narnia.plutotech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
::> 
::>     Boy, weren't we lucky that all BT model names were 4 characters!
::
::Of course they are always 4 characters long.  How do you think the programmer
::determined the correct amount of space to allocate for the name information
::in the first place?
::
::--
::Justin

    Well, yes, but the obvious problem is that at some future point someone
    adds a 5-character model and, BEWM.

    In general, this is why we need either snprintf()'s or very well 
    documented strncpy()'s.  None of those strncpy()'s special 'expected' 
    side effects were documented at all, which is bad.  They need to be
    documented if they are going to remain in there.

						-Matt

    Matthew Dillon  Engineering, HiWay Technologies, Inc. & BEST Internet 
                    Communications & God knows what else.
    <dillon@backplane.com> (Please include original email in any response)    

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811210638.WAA21040>