cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Access violation in dprintf_formatf (on 100% progress?)

From: Thorsten Schöning <tschoening_at_am-soft.de>
Date: Sun, 27 Sep 2015 16:43:24 +0200

Guten Tag Daniel Stenberg,
am Samstag, 26. September 2015 um 23:55 schrieben Sie:

> Sounds like it is off-by one in reading arguments off the stack so that it got
> the subsequent number instead of the string it was meant to get. From the
> fprintf() at lib/progress,c:467.

This seems to be the right track, I didn't recognized it before but
the progress output is completely broken if I use the curl versions of
the *printf functions:

> % Total % Received % Xferd Average Speed Time Time Time Current
> Dload Upload Total Spent Left Speed
> 100 (nil) 1636520 (nil) 0 13970 (nil) (nil) 0 89551 0 --:--:--

If I change curl_printf.h to not redefine the default functions, the
access violation is gone and the output looks a lot better:

> % Total % Received % Xferd Average Speed Time Time Time Current
> Dload Upload Total Spent Left Speed
> 100 13970 100 13970 0 0 49715 0 --:--:-- --:--:-- --:--:-- 52716

mprintf.h lets me choose if I want default functions to be replaced,
curl_printf.h doesn't. Using "#error test" in mprintf.h I made sure
that _MPRINTF_REPLACE is not defined.

What's the reason behind this replacement and why is curl_printf doing
it unconditionally?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening_at_AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-09-27