ole32: Remove dead code in errorinfo.c (Coverity)

Jeff L lats at yless4u.com.au
Sat Oct 14 04:51:43 CDT 2006


This patch passes all of the ole32 tests but as it is not a windows api, 
I have worked a test for the change.

Changelog:
Remove dead code from errorinfo.c (coverity CID-2)

Jeff Latimer
-------------- next part --------------
>From 53f567af0acf20bf23965a8737aa71eba5165f67 Mon Sep 17 00:00:00 2001
From: Jeff Latimer <lats at yless4u.com.au>
Date: Sat, 14 Oct 2006 19:40:49 +1000
Subject: [PATCH] ole32: Remove dead code
To: wine-patches <wine-patches at winehq.org>

---
 dlls/ole32/errorinfo.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/dlls/ole32/errorinfo.c b/dlls/ole32/errorinfo.c
index 62e27e0..b7ce50a 100644
--- a/dlls/ole32/errorinfo.c
+++ b/dlls/ole32/errorinfo.c
@@ -83,14 +83,10 @@ static BSTR WINAPI ERRORINFO_SysAllocStr
     newBuffer++;
 
     /*
-     * Copy the information in the buffer.
-     * Since it is valid to pass a NULL pointer here, we'll initialize the
-     * buffer to nul if it is the case.
+     * Copy the information in the buffer.  It is not possible to pass 
+     * a NULL pointer here. 
      */
-    if (in != 0)
-      memcpy(newBuffer, in, bufferSize);
-    else
-      memset(newBuffer, 0, bufferSize);
+    memcpy(newBuffer, in, bufferSize);
 
     /*
      * Make sure that there is a nul character at the end of the
-- 
1.4.2.3



More information about the wine-patches mailing list