bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] Format-string mismatch in utils.c


From: Daniel Macks
Subject: [Bug-wget] Format-string mismatch in utils.c
Date: Fri, 22 Dec 2017 00:38:26 -0500
User-agent: Microsoft-MacOutlook/f.29.0.171205

Building wget-1.19.2 on OS X 10.13, I get:

gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/sw/etc/wgetrc\" 
-DLOCALEDIR=\"/sw/share/locale\" -I.  -I../lib -I../lib -I/sw/include  
-I/sw/include -I/sw/include -I/sw/include -I/sw/include -DNDEBUG  -MT utils.o 
-MD -MP -MF .deps/utils.Tpo -c -o utils.o utils.c
utils.c:2822:24: warning: format specifies type 'int' but the argument has type 
'unsigned long' [-Wformat]
                       (strlen (begin_pos + 8) * 3) / 4, SHA256_DIGEST_SIZE,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The actual code (a diagnostic about a wrong size:) is:
            logprintf (LOG_VERBOSE, _ ("Skipping key with wrong size (%d/%d): 
%s\n"),                   
                       (strlen (begin_pos + 8) * 3) / 4, SHA256_DIGEST_SIZE,    
                        
                       quote (begin_pos + 8));                                  
                        

where strlen() returns a size_t. Changing the format-string from (%d/%d) to 
(%lu/%d) solves it for me.

dan
-- 
Daniel Macks
address@hidden
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]