Re: cvs commit: src/sbin/sysctl Makefile sysctl.c

看板DFBSD_commit作者時間21年前 (2005/01/18 11:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
On Tue, 18 Jan 2005 11:46:55 +0900 YONETANI Tomokazu <qhwt+dfly@les.ath.cx> wrote: > On Mon, Jan 10, 2005 at 12:27:51PM -0800, Chris Pressey wrote: > > replace printf() with fwrite() in one instance; > > Now `sysctl kern.ostype | less' looks like this: > kern.ostype: DragonFly^@ > > val and len after the call to sysctl() look like this: > val = {'D','r','a','g','o','n','F','l','y','\0'} > len = 10 > so feeding them to fwrite() prints out the last '\0' while feeding them > to printf() does not. The fwrite() just above it should be OK because > it's only used when the user specified '-b' flag to treat the value > as a raw binary. Thanks. I've applied a fix. -Chris
文章代碼(AID): #11x8Cs00 (DFBSD_commit)
文章代碼(AID): #11x8Cs00 (DFBSD_commit)