Small fixes to avoid warnings with newer gcc

This commit is contained in:
Karsten Keil 2007-03-05 18:04:35 +00:00
parent 3a210bb73b
commit c0760da336
5 changed files with 18 additions and 6 deletions

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.3 2002/01/31 18:50:51 paul
* #include <stdlib.h> for prototypes against warnings.
*
* Revision 1.2 1999/09/06 08:03:23 fritz
* Changed my mail-address.
*
@ -70,7 +73,7 @@ main(int argc, char **argv)
act2000_cdef newcard;
cmd = strrchr(argv[0], '/');
cmd = (cmd == NULL) ? argv[0] : ++cmd;
cmd = (cmd == NULL) ? argv[0] : cmd + 1;
if (argc > 1) {
if (!strcmp(argv[1], "-d")) {
strcpy(ioctl_s.drvid, argv[2]);

View File

@ -88,7 +88,8 @@ static char * tdu_print_file_par( int ct, unsigned char *pkt, unsigned char *end
if( pkt >= end ) goto packet_too_small;
if( (len = *(pkt++)) == 0xff ) {
if( pkt+2 > end ) goto packet_too_small;
len = 0x100 * *(pkt++) + *(pkt++);
len = 0x100 * pkt[0] + pkt[1];
pkt += 2;
}
tdu_printf (ct,"len=%d)", len);
ret = pkt + len;

View File

@ -169,7 +169,7 @@ int tdu_log_prefix(const char * id_fmt, const char *tm_fmt)
int tdu_printf( int context, char * fmt, ... )
{
int ret, nl, i;
int ret = 0, nl, i;
va_list ap;
char tst[20];
@ -409,7 +409,8 @@ unsigned char * tdu_print_par( int ct, unsigned char *pkt, unsigned char *end, i
if( pkt >= end ) goto packet_too_small;
if( (len = *(pkt++)) == 0xff ) {
if( pkt+2 > end ) goto packet_too_small;
len = 0x100 * *(pkt++) + *(pkt++);
len = 0x100 * pkt[0] + pkt[1];
pkt += 2;
}
tdu_printf(ct,"len=%d)", len);
ret = pkt + len;

View File

@ -22,6 +22,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.5 2002/01/31 18:55:45 paul
* #include <stdlib.h> for prototypes against warnings.
*
* Revision 1.4 1999/09/06 08:03:24 fritz
* Changed my mail-address.
*
@ -220,7 +223,7 @@ main(int argc, char **argv)
icn_cdef newcard;
cmd = strrchr(argv[0], '/');
cmd = (cmd == NULL) ? argv[0] : ++cmd;
cmd = (cmd == NULL) ? argv[0] : cmd + 1;
if (argc > 1) {
if (!strcmp(argv[1], "-d")) {
strcpy(ioctl_s.drvid, argv[2]);

View File

@ -21,6 +21,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.3 1999/09/06 08:03:26 fritz
* Changed my mail-address.
*
* Revision 1.2 1997/05/17 12:23:41 fritz
* Corrected some Copyright notes to refer to GPL.
*
@ -30,6 +33,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <fcntl.h>
@ -172,7 +176,7 @@ main(int argc, char **argv)
isdnloop_sdef startparm;
cmd = strrchr(argv[0], '/');
cmd = (cmd == NULL) ? argv[0] : ++cmd;
cmd = (cmd == NULL) ? argv[0] : cmd + 1;
if (argc > 1) {
if (!strcmp(argv[1], "-d")) {
strcpy(ioctl_s.drvid, argv[2]);