commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-170-ge2833


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-170-ge28334c
Date: Fri, 14 Sep 2012 13:36:37 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  e28334cfec659d6d7ac064ecffbc7948bc91fd54 (commit)
      from  7faf49c035c277daa3f8e01d1581223ab2a4a8e4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=e28334cfec659d6d7ac064ecffbc7948bc91fd54


commit e28334cfec659d6d7ac064ecffbc7948bc91fd54
Author: Mats Erik Andersson <address@hidden>
Date:   Fri Sep 14 14:37:08 2012 +0200

    telnetd: More compiler warnings.

diff --git a/ChangeLog b/ChangeLog
index 3c4fecf..21f93ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2012-09-14  Mats Erik Andersson  <address@hidden>
 
+       telnetd: More compiler warnings.
+
+       * am/libcurses.m4 (IU_LIB_TERMCAP): Use AC_LINK_IFELSE
+       instead of AC_CHECK_DECLS to find declaration of tgetent.
+       * telnetd/term.c (copy_termbuf) [TIOCPKT_IOCTL]: Declare
+       LEN as size_t.  Increment LEN in loop.
+       * telnetd/utility.c (printdata): Cast *PTR as int.
+
+2012-09-14  Mats Erik Andersson  <address@hidden>
+
        telnetd: Compiler warnings.
 
        * telnetd/pty.c (startslave) [!AUTHENTICATION]:
diff --git a/am/libcurses.m4 b/am/libcurses.m4
index 45cacc4..37aa650 100644
--- a/am/libcurses.m4
+++ b/am/libcurses.m4
@@ -91,20 +91,42 @@ AC_DEFUN([IU_LIB_TERMCAP], [
   if test "$LIBNCURSES"; then
     LIBTERMCAP="$LIBNCURSES"
   else
+    dnl Must check declaration in different settings,
+    dnl so caching in AC_CHECK_DECL is too distructive.
+    dnl
+    _IU_SAVE_LIBS=$LIBS
     AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP=-ltermcap)
-    AC_CHECK_DECLS([tgetent], , , [[#include <termcap.h>]])
+    AC_MSG_CHECKING([where tgetent is declared])
+    location_tgetent=none
+    LIBS="$LIBS $LIBTERMCAP"
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM([[#include <termcap.h>]],
+       [[(void) tgetent((char *) 0, (char *) 0);]])],
+      [AC_DEFINE([HAVE_TERMCAP_TGETENT], 1,
+       [Define to 1 if tgetent() exists in <termcap.h>.])
+       ac_cv_have_decl_tgetent=yes
+       location_tgetent=termcap.h],
+      [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM([[#include <curses.h>
+#include <term.h>]],
+         [[(void) tgetent((char *) 0, (char *) 0);]])],
+       [AC_DEFINE([HAVE_CURSES_TGETENT], 1,
+         [Define to 1 if tgetent() exists in <term.h>.])
+        ac_cv_have_decl_tgetent=yes
+        location_tgetent=term.h])
+      ])
+    LIBS=$_IU_SAVE_LIBS
+
     if test "$ac_cv_lib_termcap_tgetent" = yes \
        && test "$ac_cv_have_decl_tgetent" = yes; then
-      AC_DEFINE([HAVE_TERMCAP_TGETENT], 1,
-               [Define to 1 if tgetent() exists in <termcap.h>.])
+      AC_MSG_RESULT($location_tgetent)
     else
       AC_CHECK_LIB(curses, tgetent, LIBTERMCAP=-lcurses)
       AC_CHECK_DECLS([tgetent], , , [[#include <curses.h>
 #include <term.h>]])
       if test "$ac_cv_lib_curses_tgetent" = yes \
          && test "$ac_cv_have_decl_tgetent" = yes; then
-       AC_DEFINE([HAVE_CURSES_TGETENT], 1,
-                 [Define to 1 if tgetent() exists in <curses.h>.])
+       AC_DEFINE([HAVE_CURSES_TGETENT], 1)
       fi
     fi
     if test "$ac_cv_lib_curses_tgetent" = no \
diff --git a/telnetd/term.c b/telnetd/term.c
index 2b74610..77d1177 100644
--- a/telnetd/term.c
+++ b/telnetd/term.c
@@ -506,11 +506,12 @@ init_termbuf (void)
 }
 
 #if defined TIOCPKT_IOCTL
-/*FIXME: Hardly needed*/
+/*FIXME: Hardly needed?
+ * Built by OpenSolaris and BSD, though.  */
 void
 copy_termbuf ()
 {
-  int len = 0;
+  size_t len = 0;
   char *cp = (char *) &termbuf;
 
   while (pty_input_level () > 0)
@@ -518,6 +519,7 @@ copy_termbuf ()
       if (len >= sizeof (termbuf))
        break;
       *cp++ = pty_get_char (0);
+      len++;
     }
   termbuf2 = termbuf;
 }
diff --git a/telnetd/utility.c b/telnetd/utility.c
index 0ca1f99..5ca0430 100644
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -928,7 +928,7 @@ printoption (register char *fmt, register int option)
 void
 printsub (int direction, unsigned char *pointer, int length)
 {
-  register int i;
+  register int i = 0;
 
 #if defined AUTHENTICATION && defined ENCRYPTION
   unsigned char buf[512];
@@ -1565,7 +1565,7 @@ printdata (register char *tag, register char *ptr, 
register int cnt)
       for (i = 0; i < 20 && cnt; i++)
        {
          debug_output_data ("%02x", *ptr);
-         xbuf[i] = isprint (*ptr) ? *ptr : '.';
+         xbuf[i] = isprint ((int) *ptr) ? *ptr : '.';
 
          if (i % 2)
            debug_output_data (" ");

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |   10 ++++++++++
 am/libcurses.m4   |   32 +++++++++++++++++++++++++++-----
 telnetd/term.c    |    6 ++++--
 telnetd/utility.c |    4 ++--
 4 files changed, 43 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]