vdr 1.3.44: more format string checking

Message ID 4E081D9E82%linux@youmustbejoking.demon.co.uk
State New
Headers

Commit Message

Darren Salt March 15, 2006, 6:27 p.m. UTC
  I demand that C.Y.M may or may not have written...

> Darren Salt wrote:
>> I've done a build of vdr 1.3.44 with -Wformat=2. This was noisier than it
>> might be due to some tr() calls; however, in <libintl.h>, I've spotted
>> something of use:
>>   __attribute_format_arg__ (index)
[snip]

> With this patch applied, I get a lot of these (null) messages in my log:

> Mar 15 04:07:31 sid vdr: [26388] (null) thread started (pid=26388, tid=26388)
> Mar 15 04:07:31 sid vdr: [26389] (null) thread started (pid=26389, tid=26389)

Presumably, the cThread object is being initialised with a null description.
This is cosmetic, but the attached patch, applied on top of my previous
patch, should fix it.
  

Patch

--- vdr-1.3.44~/thread.c
+++ vdr-1.3.44/thread.c
@@ -208,7 +208,8 @@ 
   childTid = 0;
   childThreadId = 0;
   description = NULL;
-  SetDescription("%s", Description);
+  if (Description)
+    SetDescription("%s", Description);
 }
 
 cThread::~cThread()