]> git.pld-linux.org Git - packages/postfix.git/commitdiff
- 64-bit long long support in vbuf_print() auto/th/postfix-2.11.8-1
authorAdam Osuchowski <adwol@pld-linux.org>
Thu, 4 Aug 2016 21:46:06 +0000 (23:46 +0200)
committerAdam Osuchowski <adwol@pld-linux.org>
Thu, 4 Aug 2016 21:46:06 +0000 (23:46 +0200)
postfix-vbuf_print.patch [new file with mode: 0644]
postfix.spec

diff --git a/postfix-vbuf_print.patch b/postfix-vbuf_print.patch
new file mode 100644 (file)
index 0000000..e1bd572
--- /dev/null
@@ -0,0 +1,48 @@
+--- postfix-2.9.4.orig/src/util/vbuf_print.c   2012-09-19 20:00:06.000000000 +0200
++++ postfix-2.9.4/src/util/vbuf_print.c        2012-09-19 20:06:01.000000000 +0200
+@@ -122,7 +122,7 @@
+     unsigned char *cp;
+     int     width;                    /* width and numerical precision */
+     int     prec;                     /* are signed for overflow defense */
+-    unsigned long_flag;                       /* long or plain integer */
++    unsigned long_flag;                       /* long long or long or plain integer */
+     int     ch;
+     char   *s;
+@@ -193,8 +193,17 @@
+               msg_warn("%s: bad precision %d in %.50s", myname, prec, format);
+               prec = 0;
+           }
+-          if ((long_flag = (*cp == 'l')) != 0)/* long whatever */
++          /* long whatever */
++          long_flag = 0;
++          if (*cp == 'l') {
++              long_flag++;
+               VSTRING_ADDCH(fmt, *cp++);
++
++              if (*cp == 'l') {
++                long_flag++;
++                VSTRING_ADDCH(fmt, *cp++);
++              }
++          }
+           if (*cp == 0)                       /* premature end, punt */
+               break;
+           VSTRING_ADDCH(fmt, *cp);            /* type (checked below) */
+@@ -220,13 +229,16 @@
+               break;
+           case 'c':                           /* integral-valued argument */
+           case 'd':
++          case 'i':
+           case 'u':
+           case 'o':
+           case 'x':
+           case 'X':
+               if (VBUF_SPACE(bp, (width > prec ? width : prec) + INT_SPACE))
+                   return (bp);
+-              if (long_flag)
++              if (long_flag > 1)
++                  sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, long long));
++              else if (long_flag == 1)
+                   sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, long));
+               else
+                   sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, int));
index 37c0b18f4e2bd4e0936d842fc0938f03b6597074..46e4bd3d3aa892c33b50988e71aa37d3183e09cc 100644 (file)
@@ -71,6 +71,7 @@ Patch10:      %{name}-link.patch
 Patch11:       %{name}-scache_clnt.patch
 Patch12:       format-security.patch
 Patch13:       %{name}-no_cdb.patch
+Patch14:       %{name}-vbuf_print.patch
 URL:           http://www.postfix.org/
 %{?with_sasl:BuildRequires:    cyrus-sasl-devel}
 BuildRequires: db-devel
@@ -299,6 +300,7 @@ sed -i '/scache_clnt_create/s/server/var_scache_service/' src/global/scache_clnt
 %patch12 -p1
 %endif
 %{!?with_cdb:%patch13 -p1}
+%patch14 -p1
 
 %if %{with tcp}
 sed -i 's/ifdef SNAPSHOT/if 1/' src/util/dict_open.c
This page took 0.190255 seconds and 4 git commands to generate.