Hi!

The included snprintf function outputs pointers as signed numbers
leading to bad things<tm>. It seems that you don't wish to use
%p, but it also seems that you do in fact use it. So, this can't
be a bad patch, right? Also think about the poor sods borrowing
your snprintf implementation. Errmh, that would be me, I'm just
contributing back...

I have attached a patch. Please CC me, I'm not subscribed...

2009-12-03  Peter Rosin  <[email protected]>

        * snprintf.c (dopr): Output %p as unsigned.


Cheers,
Peter

--
They are in the crowd with the answer before the question.
> Why do you dislike Jeopardy?
# HG changeset patch
# User Peter Rosin <[email protected]>
# Date 1259854851 -3600
# Node ID 6c69fd6c6709e0142c2518314da49a6468d1953e
# Parent  38a0105c05eadbdd3e698d1073981e6d79c3df8c
Output %p as unsigned.

diff -r 38a0105c05ea -r 6c69fd6c6709 src/ChangeLog
--- a/src/ChangeLog     Sat Oct 24 16:06:44 2009 -0700
+++ b/src/ChangeLog     Thu Dec 03 16:40:51 2009 +0100
@@ -1,3 +1,7 @@
+2009-12-03  Peter Rosin  <[email protected]>
+
+       * snprintf.c (dopr): Output %p as unsigned.
+
 2009-10-24  Petr Pisar  <[email protected]>
 
        * openssl.c: Implement support for (multiple) subjectAltNames in
diff -r 38a0105c05ea -r 6c69fd6c6709 src/snprintf.c
--- a/src/snprintf.c    Sat Oct 24 16:06:44 2009 -0700
+++ b/src/snprintf.c    Thu Dec 03 16:40:51 2009 +0100
@@ -403,6 +403,7 @@
         total += fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
         break;
       case 'p':
+        flags |= DP_F_UNSIGNED;
         strvalue = va_arg (args, void *);
         total += fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min,
                          max, flags);

Reply via email to