Fix a bogus (misspelled) declaration for databinchk() in
"include/databin.h".

Then, change databinchk() so that its second argument is a signed
rather than an unsigned character pointer.  This is consistent with
the way it is used throughout the code.  Because of the way that
argument is used, it won't change the behavior of that function; its
value is immediately assigned to a local variable, which is still
unsigned.  Add a cast in that assignment to force the conversion.

Signed-off-by: Alex Elder <[email protected]>
---
 include/databin.h |    2 +-
 lib/databin.c     |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/databin.h b/include/databin.h
index c168799..93c3863 100644
--- a/include/databin.h
+++ b/include/databin.h
@@ -39,6 +39,6 @@
 
 void databingen( int mode, char *buffer, int bsize, int offset );
 
-void databinchedk( int mode, unsigned char *buffer, int bsize, int offset, 
char **errmsg);
+int databinchk( int mode, char *buffer, int bsize, int offset, char **errmsg);
 
 #endif
diff --git a/lib/databin.c b/lib/databin.c
index 6659ccf..c0f4307 100644
--- a/lib/databin.c
+++ b/lib/databin.c
@@ -91,7 +91,7 @@ int ind;
 int
 databinchk(mode, buffer, bsize, offset, errmsg)
 int mode;      /* either a, c, r, z, o, or C */
-unsigned char *buffer; /* buffer pointer */
+char *buffer;  /* buffer pointer */
 int bsize;     /* size of buffer */
 int offset;    /* offset into the file where buffer starts */
 char **errmsg;
@@ -102,7 +102,7 @@ char **errmsg;
     long expbits;
     long actbits;
 
-       chr=buffer;
+       chr = (unsigned char *) buffer;
        total=bsize;
 
        if (errmsg != NULL) {
-- 
1.7.4


------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to