Source-Changes-HG archive

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

[src/trunk]: src/lib/libterm Ensure limit is sane on return from t_getstr if ...



details:   https://anonhg.NetBSD.org/src/rev/8600052e31f5
branches:  trunk
changeset: 485122:8600052e31f5
user:      blymn <blymn%NetBSD.org@localhost>
date:      Wed Apr 19 15:32:28 2000 +0000

description:
Ensure limit is sane on return from t_getstr if requested entry does
not exist.

diffstat:

 lib/libterm/termcap.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r 8fbae216a165 -r 8600052e31f5 lib/libterm/termcap.c
--- a/lib/libterm/termcap.c     Wed Apr 19 15:16:02 2000 +0000
+++ b/lib/libterm/termcap.c     Wed Apr 19 15:32:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: termcap.c,v 1.24 2000/04/19 13:41:28 blymn Exp $       */
+/*     $NetBSD: termcap.c,v 1.25 2000/04/19 15:32:28 blymn Exp $       */
 
 /*
  * Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)termcap.c  8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: termcap.c,v 1.24 2000/04/19 13:41:28 blymn Exp $");
+__RCSID("$NetBSD: termcap.c,v 1.25 2000/04/19 15:32:28 blymn Exp $");
 #endif
 #endif /* not lint */
 
@@ -291,12 +291,10 @@
        ids[1] = id[1];
        ids[2] = '\0';
 
-       if ((ids[0] == 'Z') && (ids[1] == 'Z')) {
-                 /* return info->info address??? */
-       }
-       
        if ((i = cgetstr(info->info, ids, &s)) < 0) {
                errno = ENOENT;
+               if (limit != NULL)
+                       *limit = 0;
                return NULL;
        }
        



Home | Main Index | Thread Index | Old Index