Subject: Re: CVS commit: src/sys
To: Klaus Klein <kleink@mibh.de>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-kern
Date: 04/24/2004 09:46:23
>I've cleaned up after this change (which involved bumping the kernel
>version, updating libpci and bumping its major, and updating assorted
>documentation).
Cool - so it compiles now? My sparc build was dying on:
pci_subr.c(656): warning: c89 C does not support 'long long' [265]
>+ cp += snprintf(cp, ep - cp, "%svendor 0x%04x product 0x%04x",
As you say, this is dangerous and all too common.
It is an appealing approach though, so its probably worth doing a
safe_snprinf() that will return 0 in the not enough space
case to avoid the overflow issues.
If the above is in the kernel and DIAGNOSTIC is defined, a panic might
be in order for the out of room case?
--sjg