Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't delete the leading zero in a hex number if the hex number is ju…
…st 0.
  • Loading branch information
colomon committed Jul 6, 2012
1 parent 9c29580 commit f36d743
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Printf.cs
Expand Up @@ -198,7 +198,7 @@ private struct PrintfFormat {
}

private static string RemoveInitialZero(String s) {
if (s[0] == '0') {
if (s.Length > 1 && s[0] == '0') {
return s.Substring(1);
}
return s;
Expand Down

0 comments on commit f36d743

Please sign in to comment.