Check if width is zero or negative before fill; fix #3347

Reported by https://hackerone.com/haquaman.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-12-17 23:37:35 +09:00
parent 2edf15bed8
commit 432570723d
+2 -2
View File
@@ -720,10 +720,10 @@ retry:
CHECK(n);
memcpy(buf+blen, c, n);
blen += n;
FILL(' ', width-1);
if (width>0) FILL(' ', width-1);
}
else {
FILL(' ', width-1);
if (width>0) FILL(' ', width-1);
CHECK(n);
memcpy(buf+blen, c, n);
blen += n;