From: tholo Date: Sat, 14 Dec 1996 07:18:47 +0000 (+0000) Subject: Use size_t more places X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b7d21b761d06b119d7595af0e954d568472c0392;p=openbsd Use size_t more places --- diff --git a/lib/libtermlib/getterm.c b/lib/libtermlib/getterm.c index c6216ab02c5..47e282c614b 100644 --- a/lib/libtermlib/getterm.c +++ b/lib/libtermlib/getterm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getterm.c,v 1.12 1996/12/09 01:18:17 tholo Exp $ */ +/* $OpenBSD: getterm.c,v 1.13 1996/12/14 07:18:47 tholo Exp $ */ /* * Copyright (c) 1996 SigmaSoft, Th. Lockert @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: getterm.c,v 1.12 1996/12/09 01:18:17 tholo Exp $"; +static char rcsid[] = "$OpenBSD: getterm.c,v 1.13 1996/12/14 07:18:47 tholo Exp $"; #endif #include @@ -148,14 +148,14 @@ _ti_gettermcap(name) ttytype[MAXSIZE - 1] = '\0'; } else { - int n; + size_t n; n = s - dummy - (dummy[2] == '|' ? 3 : 0); cur_term->names = malloc(n + 1); strncpy(cur_term->names, dummy + (dummy[2] == '|' ? 3 : 0), n); cur_term->names[n] = '\0'; strncpy(ttytype, dummy + (dummy[2] == '|' ? 3 : 0), - MIN(MAXSIZE - 1, s - dummy)); + (size_t)MIN(MAXSIZE - 1, s - dummy)); ttytype[MAXSIZE - 1] = '\0'; *home = '\0'; while (s > dummy && *s != '|') @@ -297,14 +297,14 @@ _ti_getterminfo(name) ttytype[MAXSIZE - 1] = '\0'; } else { - int n; + size_t n; n = s - dummy - (dummy[2] == '|' ? 3 : 0); cur_term->names = malloc(n + 1); strncpy(cur_term->names, dummy + (dummy[2] == '|' ? 3 : 0), n); cur_term->names[n] = '\0'; strncpy(ttytype, dummy + (dummy[2] == '|' ? 3 : 0), - MIN(MAXSIZE - 1, s - dummy)); + (size_t)MIN(MAXSIZE - 1, s - dummy)); ttytype[MAXSIZE - 1] = '\0'; *home = '\0'; while (s > dummy && *s != '|')