summaryrefslogtreecommitdiffhomepage
path: root/src/sprintf.c
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-06-21 16:22:29 +0900
committerYukihiro Matsumoto <[email protected]>2012-06-21 16:22:29 +0900
commita70c4e0c790b9ddb4dbca143cffa585b3841b9f6 (patch)
tree1cbbe65814a65c8969b1337bdb0fadae32b85e70 /src/sprintf.c
parentd105ea496f686b6ef3071e127864fab4677befac (diff)
downloadmruby-a70c4e0c790b9ddb4dbca143cffa585b3841b9f6.tar.gz
mruby-a70c4e0c790b9ddb4dbca143cffa585b3841b9f6.zip
reduce calling of strlen(); #301
Diffstat (limited to 'src/sprintf.c')
-rw-r--r--src/sprintf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sprintf.c b/src/sprintf.c
index b4d460c83..c23969792 100644
--- a/src/sprintf.c
+++ b/src/sprintf.c
@@ -1069,13 +1069,13 @@ fmt_setup(char *buf, size_t size, int c, int flags, int width, int prec)
if (flags & FSPACE) *buf++ = ' ';
if (flags & FWIDTH) {
- snprintf(buf, end - buf, "%d", width);
- buf += strlen(buf);
+ snprintf(buf, end - buf, "%d", width);
+ buf += strlen(buf);
}
if (flags & FPREC) {
- snprintf(buf, end - buf, ".%d", prec);
- buf += strlen(buf);
+ snprintf(buf, end - buf, ".%d", prec);
+ buf += strlen(buf);
}
*buf++ = c;