cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1723194 ] wrong output when print wrong ftp-method

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 24 May 2007 13:58:39 -0700

Bugs item #1723194, was opened at 2007-05-22 05:35
Message generated for change (Comment added) made by bagder
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: Closed
>Resolution: Fixed
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.

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2007-05-24 22:58

Message:
Logged In: YES
user_id=1110
Originator: NO

Thanks, applied!

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1723194&group_id=976
Received on 2007-05-24

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET