Subject: lib/1104: compile warnings in telnet library
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: Thorsten Lockert <tholo@SigmaSoft.COM>
List: netbsd-bugs
Date: 06/03/1995 21:35:04
>Number:         1104
>Category:       lib
>Synopsis:       compile warnings in telnet library
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun  3 21:35:02 1995
>Originator:     Thorsten Lockert
>Organization:
SigmaSoft, Th. Lockert
>Release:        May 28, 1995
>Environment:
	
System: NetBSD gandalf.sigmasoft.com 1.0A NetBSD 1.0A (GANDALF) #1: Sun May 7 21:49:27 PDT 1995 tholo@gandalf.sigmasoft.com:/usr/src/sys/arch/i386/compile/GANDALF i386


>Description:
	There are compile warnings in src/lib/libtelnet when compiled
	with -Wall -Wstrict-prototypes

>How-To-Repeat:
	Compile with -Wall -Wstrict-prototypes

>Fix:
	Apply the following patches:

diff -c src/lib/libtelnet.orig/genget.c src/lib/libtelnet/genget.c
*** src/lib/libtelnet.orig/genget.c	Sat Jun  3 21:09:44 1995
--- src/lib/libtelnet/genget.c	Sat Jun  3 21:18:47 1995
***************
*** 36,43 ****
  static char *rcsid = "$Id: genget.c,v 1.3 1994/02/25 02:52:59 cgd Exp $";
  #endif /* not lint */
  
- 
  #include <ctype.h>
  
  #define	LOWER(x) (isupper(x) ? tolower(x) : (x))
  /*
--- 36,47 ----
  static char *rcsid = "$Id: genget.c,v 1.3 1994/02/25 02:52:59 cgd Exp $";
  #endif /* not lint */
  
  #include <ctype.h>
+ #include "misc-proto.h"
+ 
+ int isprefix P((char *, char *));
+ char **genget P((char *, char **, int));
+ int Ambiguous P((char *));
  
  #define	LOWER(x) (isupper(x) ? tolower(x) : (x))
  /*
***************
*** 46,56 ****
   * the length is returned.  If *s1 is a prefix of *s2,
   * the length of *s1 is returned.
   */
! 	int
  isprefix(s1, s2)
! 	register char *s1, *s2;
  {
-         register int n = 0;
          char *os1;
  	register char c1, c2;
  
--- 50,59 ----
   * the length is returned.  If *s1 is a prefix of *s2,
   * the length of *s1 is returned.
   */
! int
  isprefix(s1, s2)
! register char *s1, *s2;
  {
          char *os1;
  	register char c1, c2;
  
***************
*** 70,80 ****
  
  static char *ambiguous;		/* special return value for command routines */
  
! 	char **
  genget(name, table, stlen)
! 	char	*name;		/* name to match */
! 	char	**table;	/* name entry in table */
! 	int	stlen;
  {
  	register char **c, **found;
  	register int n;
--- 73,83 ----
  
  static char *ambiguous;		/* special return value for command routines */
  
! char **
  genget(name, table, stlen)
! char	*name;		/* name to match */
! char	**table;	/* name entry in table */
! int	stlen;
  {
  	register char **c, **found;
  	register int n;
***************
*** 98,106 ****
  /*
   * Function call version of Ambiguous()
   */
! 	int
  Ambiguous(s)
! 	char *s;
  {
  	return((char **)s == &ambiguous);
  }
--- 101,109 ----
  /*
   * Function call version of Ambiguous()
   */
! int
  Ambiguous(s)
! char *s;
  {
  	return((char **)s == &ambiguous);
  }
diff -c src/lib/libtelnet.orig/getent.c src/lib/libtelnet/getent.c
*** src/lib/libtelnet.orig/getent.c	Sat Jun  3 21:09:44 1995
--- src/lib/libtelnet/getent.c	Sat Jun  3 21:18:30 1995
***************
*** 36,44 ****
--- 36,51 ----
  static char *rcsid = "$Id: getent.c,v 1.3 1994/02/25 02:53:01 cgd Exp $";
  #endif /* not lint */
  
+ #include <stdlib.h>
+ #include "misc-proto.h"
+ 
  static char *area;
  
+ int getent P((char *, char *));
+ char *getstr P((char *, char **));
+ 
  /*ARGSUSED*/
+ int
  getent(cp, name)
  char *cp, *name;
  {
diff -c src/lib/libtelnet.orig/misc-proto.h src/lib/libtelnet/misc-proto.h
*** src/lib/libtelnet.orig/misc-proto.h	Sat Jun  3 21:09:44 1995
--- src/lib/libtelnet/misc-proto.h	Sat Jun  3 21:17:04 1995
***************
*** 66,71 ****
--- 66,72 ----
  #endif
  
  void auth_encrypt_init P((char *, char *, char *, int));
+ void auth_encrypt_user P((char *));
  void auth_encrypt_connect P((int));
  void printd P((unsigned char *, int));
  
diff -c src/lib/libtelnet.orig/misc.c src/lib/libtelnet/misc.c
*** src/lib/libtelnet.orig/misc.c	Sat Jun  3 21:09:44 1995
--- src/lib/libtelnet/misc.c	Sat Jun  3 21:17:19 1995
***************
*** 36,41 ****
--- 36,44 ----
  static char *rcsid = "$Id: misc.c,v 1.3 1994/02/25 02:53:03 cgd Exp $";
  #endif /* not lint */
  
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
  #include "misc.h"
  
  char *RemoteHostName;
***************
*** 43,49 ****
  char *UserNameRequested = 0;
  int ConnectedCount = 0;
  
! 	void
  auth_encrypt_init(local, remote, name, server)
  	char *local;
  	char *remote;
--- 46,52 ----
  char *UserNameRequested = 0;
  int ConnectedCount = 0;
  
! void
  auth_encrypt_init(local, remote, name, server)
  	char *local;
  	char *remote;
***************
*** 61,87 ****
  	}
  }
  
! 	void
  auth_encrypt_user(name)
! 	char *name;
  {
- 	extern char *strdup();
- 
  	if (UserNameRequested)
  		free(UserNameRequested);
  	UserNameRequested = name ? strdup(name) : 0;
  }
  
! 	void
  auth_encrypt_connect(cnt)
! 	int cnt;
  {
  }
  
! 	void
  printd(data, cnt)
! 	unsigned char *data;
! 	int cnt;
  {
  	if (cnt > 16)
  		cnt = 16;
--- 64,88 ----
  	}
  }
  
! void
  auth_encrypt_user(name)
! char *name;
  {
  	if (UserNameRequested)
  		free(UserNameRequested);
  	UserNameRequested = name ? strdup(name) : 0;
  }
  
! void
  auth_encrypt_connect(cnt)
! int cnt;
  {
  }
  
! void
  printd(data, cnt)
! unsigned char *data;
! int cnt;
  {
  	if (cnt > 16)
  		cnt = 16;
Only in src/lib/libtelnet: obj
>Audit-Trail:
>Unformatted: