should be safer to cast to u_long than to cast down to int

This commit is contained in:
itojun 2002-11-17 04:49:18 +00:00
parent b2c857ac58
commit bc0b132907

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.52 2002/11/17 04:44:42 tsutsui Exp $ */
/* $NetBSD: main.c,v 1.53 2002/11/17 04:49:18 itojun Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1991, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95";
#else
__RCSID("$NetBSD: main.c,v 1.52 2002/11/17 04:44:42 tsutsui Exp $");
__RCSID("$NetBSD: main.c,v 1.53 2002/11/17 04:49:18 itojun Exp $");
#endif
#endif /* not lint */
@ -205,8 +205,9 @@ main(int argc, char *argv[])
if (strlcpy(labelstr, optarg, sizeof(labelstr))
>= sizeof(labelstr)) {
msg(
"WARNING Label `%s' is larger than limit of %d characters.\n",
optarg, (int)sizeof(labelstr) - 1);
"WARNING Label `%s' is larger than limit of %lu characters.\n",
optarg,
(unsigned long)sizeof(labelstr) - 1);
msg("WARNING: Using truncated label `%s'.\n",
labelstr);
}