dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] printf: use %ll instead of %j
@ 2012-12-03  7:42 Roy
  2012-12-03 14:32 ` Jonathan Nieder
       [not found] ` <50BCDA80.8000705@gigawatt.nl>
  0 siblings, 2 replies; 5+ messages in thread
From: Roy @ 2012-12-03  7:42 UTC (permalink / raw)
  To: dash

MSYS libc does not support %j[dXx] format, only %ll[dXx] is supported.

diff --git a/src/bltin/printf.c b/src/bltin/printf.c
index 893295c..12ce660 100644
--- a/src/bltin/printf.c
+++ b/src/bltin/printf.c
@@ -319,11 +319,12 @@ mklong(const char *str, const char *ch)
         char *copy;
         size_t len;

-       len = ch - str + 3;
+       len = ch - str + 4;
         STARTSTACKSTR(copy);
         copy = makestrspace(len, copy);
-       memcpy(copy, str, len - 3);
-       copy[len - 3] = 'j';
+       memcpy(copy, str, len - 4);
+       copy[len - 4] = 'l';
+       copy[len - 3] = 'l';
         copy[len - 2] = *ch;
         copy[len - 1] = '\0';
         return (copy);


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-23 10:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-03  7:42 [PATCH] printf: use %ll instead of %j Roy
2012-12-03 14:32 ` Jonathan Nieder
     [not found] ` <50BCDA80.8000705@gigawatt.nl>
2012-12-03 17:58   ` Harald van Dijk
2012-12-04  6:38     ` Jonathan Nieder
2013-08-23 10:30       ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).