Skip to content

Commit e10476a

Browse files
author
peter
committed
fmt fix
1 parent 2102ed0 commit e10476a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static void fmt(const char *str, int width)
117117
w ++;
118118
if (c == ' ' || c == '\t' || c == '\n')
119119
last = ptr;
120-
if ((width > 0 && w > width && last) || c == '\n') {
120+
if ((width > 0 && w >= width && last) || c == '\n') {
121121
while(s != last) {
122122
#ifdef _WIN32
123123
int n = utf_ff(s, last);
@@ -132,6 +132,7 @@ static void fmt(const char *str, int width)
132132
fflush(stdout);
133133
w = 0;
134134
last = s;
135+
ptr = s;
135136
continue;
136137
}
137138
}

0 commit comments

Comments
 (0)