From owner-cvs-src-old@FreeBSD.ORG Sat Jul 9 18:48:15 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22D03106564A for ; Sat, 9 Jul 2011 18:48:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 118138FC12 for ; Sat, 9 Jul 2011 18:48:15 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p69ImEpP075865 for ; Sat, 9 Jul 2011 18:48:14 GMT (envelope-from marius@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p69ImEt5075864 for cvs-src-old@freebsd.org; Sat, 9 Jul 2011 18:48:14 GMT (envelope-from marius@repoman.freebsd.org) Message-Id: <201107091848.p69ImEt5075864@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to marius@repoman.freebsd.org using -f From: Marius Strobl Date: Sat, 9 Jul 2011 18:47:51 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/sys pcpu.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jul 2011 18:48:15 -0000 marius 2011-07-09 18:47:51 UTC FreeBSD src repository Modified files: sys/sys pcpu.h Log: SVN rev 223893 on 2011-07-09 18:47:51Z by marius Fix the definition for PCPU_NAME_LEN, which is intended to fit ("CPU %d", cpuid) where cpuid <= MAXCPU. 1. sizeof(__XSTRING(MAXCPU) + 1) is a typo: typeof(__XSTRING(...) + 1) is 'char *', so sizeof() will return the size of the pointer, not the size of the string contents. The proper expression should be 'sizeof(__XSTRING(MAXCPU)) + 1'. 2. One should not add one, but substract it: sizeof() accounts for the trailing '\0' and we have two sizeof's, so the size of one '\0' should be substracted -- this will give the maximal string buffer length for CPU with its number, no less, no more. Submitted by: rea Revision Changes Path 1.55 +1 -1 src/sys/sys/pcpu.h