8000 0.4 commit · matthiaz/sprintf.js@7eb6b32 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7eb6b32

Browse files
committed
0.4 commit
1 parent 74fc261 commit 7eb6b32

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sprintf.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/**
2-
* sprintf() for JavaScript v.0.3
2+
* sprintf() for JavaScript v.0.4
33
*
44
* Copyright (c) 2007 Alexandru Marasteanu <http://alexei.417.ro/>
5+
* Thanks to David Baird (unit test and patch).
56
*
67
* This program is free software; you can redistribute it and/or modify it under
78
* the terms of the GNU General Public License as published by the Free Software
@@ -43,7 +44,7 @@ function sprintf () {
4344
}
4445
a = (/[def]/.test(m[7]) && m[2] && a > 0 ? '+' + a : a);
4546
c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';
46-
x = m[6] ? m[5] - String(a).length : m[5];
47+
x = m[5] - String(a).length;
4748
p = m[5] ? str_repeat(c, x) : '';
4849
o.push(m[4] ? a + p : p + a);
4950
}

0 commit comments

Comments
 (0)
0