Index: src/sprintf.c
===================================================================
--- src/sprintf.c	(Revision 2364)
+++ src/sprintf.c	(Arbeitskopie)
@@ -455,7 +455,7 @@
 
 /*-------------------------------------------------------------------------*/
 static void
-numadd (fmt_state_t *st, sprintf_buffer_t **buffer, int num)
+numadd (fmt_state_t *st, sprintf_buffer_t **buffer, p_int num)
 
 /* Add the <num>ber to the <buffer>.
  */
@@ -2243,7 +2243,7 @@
                   }
                   else
                   {
-                    char cheat[6];  /* Synthesized format for sprintf() */
+                    char cheat[8];  /* Synthesized format for sprintf() */
                     char temp[1024];
                       /* The buffer must be big enough to hold the biggest float
                        * in non-exponential representation. 1 KByte is hopefully
@@ -2305,12 +2305,22 @@
                          * strings can. So in that case we format with
                          * character 0x01 and convert to 0 afterwards.
                          */
-                        if (format_char == 'c' && carg->u.number == 0)
-                        {
+                        if (format_char == 'c') {
+                          if (carg->u.number == 0)
+                          {
                             carg->u.number = 1;
                             zeroCharHack = MY_TRUE;
+                          }
                         }
-
+                        else 
+                        {
+#if SIZEOF_LONG == SIZEOF_CHAR_P
+                          cheat[i++] = 'l';
+#elif defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == SIZEOF_CHAR_P
+                          cheat[i++] = 'l';
+                          cheat[i++] = 'l';
+#endif
+                        }
                         cheat[i++] = format_char;
                         cheat[i] = '\0';
                         sprintf(temp, cheat, carg->u.number);
