[ipxe-devel] show git version (was: Re: [resending] truncate menu title)
Christian Hesse
list at eworm.de
Thu Jul 5 09:20:03 UTC 2012
Christian Hesse <list at eworm.de> on Wed, 2012/07/04 09:38:
> Michael Brown <mbrown at fensystems.co.uk> on Tue, 2012/07/03 17:07:
> > On Tuesday 03 Jul 2012 16:58:14 Christian Hesse wrote:
> > > > > The attached one should be correct. We should not count the null
> > > > > byte.
> > > >
> > > > strlen() returns the length of a string excluding the terminating NUL.
> > >
> > > You are right... But sizeof() returns 81 (MENU_COLS + 1) in this case.
> > > So how about this?
> >
> > snprintf() requires the size of the buffer (including space for the
> > terminating NUL), so sizeof(buf) is correct.
>
> Hmm, everything seems to work fine now. I was hunting a ghost.
> Probably I reverted my local patch but did not pull from upstream... Sorry
> for the noise.
This brings a new idea to my mind - could be useful to have the git version
printed when booting.
I broke the line in main.c as it was longer than 80 characters and did not
fit the terminal width.
Feed free to apply and/or modify to your needs.
--
main(a,b){char*/* Schoene Gruesse */c="B?IJj;M"
"EHCX:;";for(a/* Chris get my mail address: */=0;b=c[a++];)
putchar(b-1/(/* gcc -o sig sig.c && ./sig */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipxe_gitversion.patch
Type: text/x-patch
Size: 1110 bytes
Desc: not available
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20120705/58871b34/attachment.bin>
More information about the ipxe-devel
mailing list