cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Retrieving text from a Windows server as a Mac format file?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 19 May 2011 23:54:05 +0200 (CEST)

On Thu, 19 May 2011, Armando Miguel Cerasoli Quintero wrote:

> size_t n = size * nmemb;
> userp->append((char *)buffer, n);
> std::ofstream outfile ("check_it.txt");
> outfile.write ((char *)buffer, 50);
> outfile.close();
> return n;

I don't know this code, but this snippet above is the only place you write the
received data so that's where you must be adding the extra CR character (or
whatever extra you get, your pictures weren't exactly clear since you showed
an extra CR and then a line break but what would cause a line break without
being a byte of some sort?). I suspect the outfile thing or outfile.write.

libcurl certainly does not add any extra bytes by itself.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-19