NetBSD Problem Report #1104

From gnats  Sat Jun  3 21:21:21 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.10/8.6.10) with ESMTP id VAA00665 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Sat, 3 Jun 1995 21:21:19 -0700
Message-Id: <199506040421.VAA06890@gandalf.sigmasoft.com>
Date: Sat, 3 Jun 1995 21:21:53 -0700
From: Thorsten Lockert <tholo@SigmaSoft.COM>
Reply-To: tholo@SigmaSoft.COM
To: gnats-bugs@NetBSD.ORG
Subject: compile warnings in telnet library
X-Send-Pr-Version: 3.2

>Number:         1104
>Category:       lib
>Synopsis:       compile warnings in telnet library
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 03 21:35:02 +0000 1995
>Closed-Date:    Fri Jun 23 16:03:29 +0000 1995
>Last-Modified:  
>Originator:     Thorsten Lockert
>Release:        May 28, 1995
>Organization:
SigmaSoft, Th. Lockert
>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
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: pk 
State-Changed-When: Fri Jun 23 12:03:29 EDT 1995 
State-Changed-Why:  
Applied suggested prototype/declaration changes. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.