aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-05-24 20:58:25 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-05-24 20:58:25 +0000
commit70b1900dd13d16f2e83f571407a614541d5ac9ba (patch)
treee3d532f477f3660fa412e7fdf25ba59810407997 /src
parent380e132da3557235e4eb9aa593e79c62100156ea (diff)
'mytx' in bug report #1723194 (http://curl.haxx.se/bug/view.cgi?id=1723194)
pointed out that the warnf() function in the curl tool didn't properly deal with the cases when excessively long words were used in the string to chop up.
Diffstat (limited to 'src')
-rw-r--r--src/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 8bed673cd..638c60a50 100644
--- a/src/main.c
+++ b/src/main.c
@@ -501,6 +501,10 @@ static void warnf(struct Configurable *config, const char *fmt, ...)
while(!ISSPACE(ptr[cut]) && cut) {
cut--;
}
+ if(0 == cut)
+ /* not a single cutting position was found, just cut it at the
+ max text width then! */
+ cut = WARN_TEXTWIDTH-1;
fwrite(ptr, cut + 1, 1, config->errors);
fputs("\n", config->errors);