bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] [PATCH] xheader: avoid pointer-arith warning


From: Sergey Poznyakoff
Subject: Re: [Bug-tar] [PATCH] xheader: avoid pointer-arith warning
Date: Wed, 17 Dec 2014 08:44:59 +0200

Hi Bernard,

Thanks for reporting.  I have applied the following patch.

Regards,
Sergey

>From 5a9ac8312e2336c854f6bec2d0ae404a3b3bc30d Mon Sep 17 00:00:00 2001
From: Sergey Poznyakoff <address@hidden>
Date: Wed, 17 Dec 2014 08:37:14 +0200
Subject: [PATCH] Silent a cc warning

* src/xheader.c (xheader_string_end): Make sure pointer
arithmetics applies on char*.
---
 src/xheader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xheader.c b/src/xheader.c
index b7a54a6..a5452a1 100644
--- a/src/xheader.c
+++ b/src/xheader.c
@@ -1027,7 +1027,7 @@ xheader_string_end (struct xheader *xhdr, char const 
*keyword)
     }
   x_obstack_blank (xhdr, p);
   x_obstack_1grow (xhdr, '\n');
-  cp = obstack_next_free (xhdr->stk) - xhdr->string_length - p - 1;
+  cp = (char*) obstack_next_free (xhdr->stk) - xhdr->string_length - p - 1;
   memmove (cp + p, cp, xhdr->string_length);
   cp = stpcpy (cp, np);
   *cp++ = ' ';
-- 
1.7.12.1





reply via email to

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