-const char deanimate_rcs[] = "$Id: deanimate.c,v 1.5 2001/09/10 10:16:06 oes Exp $";
+const char deanimate_rcs[] = "$Id: deanimate.c,v 1.6 2002/03/07 03:46:17 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/deanimate.c,v $
*
* Revisions :
* $Log: deanimate.c,v $
+ * Revision 1.6 2002/03/07 03:46:17 oes
+ * Fixed compiler warnings
+ *
* Revision 1.5 2001/09/10 10:16:06 oes
* Silenced compiler warnings
*
*
* Description : Ensure that a given binbuffer can hold a given amount
* of bytes, by reallocating its buffer if necessary.
- * Allocate new mem in chunks of 1000 bytes, so we don't
+ * Allocate new mem in chunks of 1024 bytes, so we don't
* have to realloc() too often.
*
* Parameters :
if (buf->offset + length > buf->size)
{
- buf->size = buf->size + length + 1000 - (buf->size + length) % 1000;
+ buf->size = ((buf->size + length + 1023) & ~1023);
newbuf = (char *)realloc(buf->buffer, buf->size);
if (newbuf == NULL)
* Returns : The byte on success, or 0 on failiure
*
*********************************************************************/
-unsigned char buf_getbyte(struct binbuffer *src, int offset)
+unsigned char buf_getbyte(struct binbuffer *src, size_t offset)
{
if (src->offset + offset < src->size)
{
*/
while((c = buf_getbyte(src, 0)))
{
- if (buf_copy(src, dst, (size_t) c + 1)) return 1;
+ if (buf_copy(src, dst, 1 + (size_t) c)) return 1;
}
if (buf_copy(src, dst, 1)) return 1;
/*
* Trim and rewind the dst buffer
*/
- if (NULL == (dst->buffer = (char *)realloc(dst->buffer, (size_t) dst->offset))) return 1;
+ if (NULL == (dst->buffer = (char *)realloc(dst->buffer, dst->offset))) return 1;
dst->size = dst->offset;
dst->offset = 0;
#ifndef DEANIMATE_H_INCLUDED
#define DEANIMATE_H_INCLUDED
-#define DEANIMATE_H_VERSION "$Id: deanimate.h,v 1.4 2001/07/29 18:50:04 jongfoster Exp $"
+#define DEANIMATE_H_VERSION "$Id: deanimate.h,v 1.5 2002/03/07 03:46:17 oes Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/deanimate.h,v $
*
* Revisions :
* $Log: deanimate.h,v $
+ * Revision 1.5 2002/03/07 03:46:17 oes
+ * Fixed compiler warnings
+ *
* Revision 1.4 2001/07/29 18:50:04 jongfoster
* Fixing "extern C" block, and renaming #define _DEANIMATE_H
*
struct binbuffer
{
char *buffer;
- int offset;
+ size_t offset;
size_t size;
};
-const char gateway_rcs[] = "$Id: gateway.c,v 1.9 2001/10/25 03:40:48 david__schmidt Exp $";
+const char gateway_rcs[] = "$Id: gateway.c,v 1.10 2002/03/07 03:50:19 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.c,v $
*
* Revisions :
* $Log: gateway.c,v $
+ * Revision 1.10 2002/03/07 03:50:19 oes
+ * - Improved handling of failed DNS lookups
+ * - Fixed compiler warnings
+ *
* Revision 1.9 2001/10/25 03:40:48 david__schmidt
* Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple
* threads to call select() simultaneously. So, it's time to do a real, live,
char sbuf[BUFFER_SIZE];
struct socks_op *c = (struct socks_op *)cbuf;
struct socks_reply *s = (struct socks_reply *)sbuf;
- int n;
+ size_t n;
size_t csiz;
int sfd;
int err = 0;
return(-1);
}
- if ((n = write_socket(sfd, (char *)c, csiz)) != csiz)
+ if (write_socket(sfd, (char *)c, csiz) != csiz)
{
log_error(LOG_LEVEL_CONNECT, "SOCKS4 negotiation write failed...");
close_socket(sfd);
return(-1);
}
- if ((n = read_socket(sfd, sbuf, sizeof(sbuf))) != sizeof(*s))
+ if (read_socket(sfd, sbuf, sizeof(sbuf)) != sizeof(*s))
{
log_error(LOG_LEVEL_CONNECT, "SOCKS4 negotiation read failed...");
close_socket(sfd);
-const char loaders_rcs[] = "$Id: loaders.c,v 1.38 2002/03/06 22:54:35 jongfoster Exp $";
+const char loaders_rcs[] = "$Id: loaders.c,v 1.39 2002/03/07 03:46:17 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loaders.c,v $
*
* Revisions :
* $Log: loaders.c,v $
+ * Revision 1.39 2002/03/07 03:46:17 oes
+ * Fixed compiler warnings
+ *
* Revision 1.38 2002/03/06 22:54:35 jongfoster
* Automated function-comment nitpicking.
*
*********************************************************************/
jb_err simple_read_line(FILE *fp, char **dest, int *newline)
{
- int len = 0;
+ size_t len = 0;
size_t buflen = BUFFER_SIZE;
char * buf;
char * p;