Bugs item #1723194, was opened at 2007-05-22 03:35
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1723194&group_id=976
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: debug/info output
Group: bad behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: mytx (mytx)
Assigned to: Daniel Stenberg (bagder)
Summary: wrong output when print wrong ftp-method
Initial Comment:
When print following command with Curl v7.16.1:
curl ftp://ftpserver/file -u ftptest:ftptest --ftp-ssl-control --cacert data/bin/ca102.crt --trace-time --key data/bin/client.key --cert data/bin/client.crt:123456 --ftp-method "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
Curl output wrong message.
And I find some source code have wrong.
On file src/main.c--warnf() function:
Line 486-508:
fputs(WARN_PREFIX, config->errors);
if(len > (int)WARN_TEXTWIDTH) {
int cut = WARN_TEXTWIDTH-1;
while(!ISSPACE(ptr[cut]) && cut) {
cut--;
}
fwrite(ptr, cut + 1, 1, config->errors);
fputs("\n", config->errors);
ptr += cut+1; /* skip the space too */
len -= cut;
And can change to:
fputs(WARN_PREFIX, config->errors);
if(len > (int)WARN_TEXTWIDTH) {
int cut = WARN_TEXTWIDTH-1;
while(!ISSPACE(ptr[cut]) && cut) {
cut--;
}
/* changed begin */
if (cut == 0)
cut = WARN_TEXTWIDTH-1;
/* changed end */
fwrite(ptr, cut + 1, 1, config->errors);
fputs("\n", config->errors);
ptr += cut+1; /* skip the space too */
/* changed begin */
len -= (cut+1);
/* changed end */
When cut=0, then ptr+=1 and len-=0, there will be wrong.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1723194&group_id=976
Received on 2007-05-22