The below patch fixes a bug in the snprintf "emulation layer". The
emulation layer does not handle a use of the asterisk that the snprintf in
a standard C library does. This patch fixes the bug and makes the
emulation layer more standard compliant.
When I wrote an extension to LPRng I wanted to use the emulation layer to
make my extension just as portable as LPRng is now, hence why I had to fix
this bug.
Patch applies to at least LPRng-3.8.20 and LPRng-3.8.21 and I would like
to see it added to the next LPRng release. I posted this patch to Patrick
Powell several months ago but never go any reply back.
I will post my configurable per IP range extension that fixes queue
listing support compatible with dtprintinfo in Solaris later this summer.
Anyone interested before that may contact me in private.
--- src/common/plp_snprintf.c.orig Sat Jan 18 00:01:25 2003
+++ src/common/plp_snprintf.c Mon Feb 3 17:25:24 2003
@@ -683,7 +683,13 @@
return;
case '-': ljust = 1; goto nextch;
case '.': set_precision = 1; precision = 0; goto nextch;
- case '*': len = va_arg( args, int ); goto nextch;
+ case '*':
+ if( set_precision ){
+ precision = va_arg( args, int );
+ } else {
+ len = va_arg( args, int );
+ }
+ goto nextch;
case '0': /* set zero padding if len not set */
if(len==0 && set_precision == 0 ) zpad = '0';
case '1': case '2': case '3':
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------