pspp-dev
[Top][All Lists]
Advanced

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

Re: [warnings 2/7] recode: Fix a warning in recode_trns_proc().


From: John Darrington
Subject: Re: [warnings 2/7] recode: Fix a warning in recode_trns_proc().
Date: Sat, 18 Sep 2010 06:48:32 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

The real problem here is the call to memcpy just a few lines down.
memcpy is as bad (worse?) than a cast, because it uses void * so
avoids typechecking.  This memcpy should be doing some recoding.
On Fri, Sep 17, 2010 at 09:36:27PM -0700, Ben Pfaff wrote:
     case_str_rw() returns uint8_t * but it was being assigned to a char *.
     Changing the type of the variable fixes the problem.
     ---
      src/language/xforms/recode.c |    2 +-
      1 files changed, 1 insertions(+), 1 deletions(-)
     
     diff --git a/src/language/xforms/recode.c b/src/language/xforms/recode.c
     index 62b03ba..424e0af 100644
     --- a/src/language/xforms/recode.c
     +++ b/src/language/xforms/recode.c
     @@ -678,7 +678,7 @@ recode_trns_proc (void *trns_, struct ccase **c, 
casenumber case_idx UNUSED)
              }
            else
              {
     -          char *dst = case_str_rw (*c, dst_var);
     +          uint8_t *dst = case_str_rw (*c, dst_var);
                if (out != NULL)
                  {
                    if (!out->copy_input)
     -- 
     1.7.1
     
     
     _______________________________________________
     pspp-dev mailing list
     address@hidden
     http://lists.gnu.org/mailman/listinfo/pspp-dev

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: signature.asc
Description: Digital signature


reply via email to

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