Date: Sun, 1 Jan 2012 23:53:16 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r229250 - stable/9/usr.sbin/yp_mkdb Message-ID: <201201012353.q01NrGIC038302@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sun Jan 1 23:53:16 2012 New Revision: 229250 URL: http://svn.freebsd.org/changeset/base/229250 Log: MFC r228722: In usr.sbin/yp_mkdb/yp_mkdb.c, cast some printf field width parameters to int, cast time_t to intmax_t, and use the corresponding printf length modifier. Modified: stable/9/usr.sbin/yp_mkdb/yp_mkdb.c Directory Properties: stable/9/usr.sbin/yp_mkdb/ (props changed) Modified: stable/9/usr.sbin/yp_mkdb/yp_mkdb.c ============================================================================== --- stable/9/usr.sbin/yp_mkdb/yp_mkdb.c Sun Jan 1 23:51:38 2012 (r229249) +++ stable/9/usr.sbin/yp_mkdb/yp_mkdb.c Sun Jan 1 23:53:16 2012 (r229250) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <err.h> #include <fcntl.h> #include <limits.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -87,7 +88,8 @@ unwind(char *map) key.data = NULL; while (yp_next_record(dbp, &key, &data, 1, 1) == YP_TRUE) - printf("%.*s %.*s\n", key.size,key.data,data.size,data.data); + printf("%.*s %.*s\n", (int)key.size, key.data, (int)data.size, + data.data); (void)(dbp->close)(dbp); return; @@ -218,7 +220,7 @@ main(int argc, char *argv[]) key.data = "YP_LAST_MODIFIED"; key.size = sizeof("YP_LAST_MODIFIED") - 1; - snprintf(buf, sizeof(buf), "%lu", time(NULL)); + snprintf(buf, sizeof(buf), "%jd", (intmax_t)time(NULL)); data.data = (char *)&buf; data.size = strlen(buf); yp_put_record(dbp, &key, &data, 0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201012353.q01NrGIC038302>