summaryrefslogtreecommitdiffstats
path: root/usr.sbin/yp_mkdb/yp_mkdb.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-12-19 20:44:44 +0000
committerdim <dim@FreeBSD.org>2011-12-19 20:44:44 +0000
commite9811a787f29bb1e1d5844807122c389e87711d1 (patch)
treed6b801e5eadb74d9ed68870d3f898188677ed6eb /usr.sbin/yp_mkdb/yp_mkdb.c
parent902ff105eca713459430f43952501314d5060350 (diff)
downloadFreeBSD-src-e9811a787f29bb1e1d5844807122c389e87711d1.zip
FreeBSD-src-e9811a787f29bb1e1d5844807122c389e87711d1.tar.gz
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. MFC after: 1 week
Diffstat (limited to 'usr.sbin/yp_mkdb/yp_mkdb.c')
-rw-r--r--usr.sbin/yp_mkdb/yp_mkdb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/yp_mkdb/yp_mkdb.c b/usr.sbin/yp_mkdb/yp_mkdb.c
index 6c3014b..f1f629a 100644
--- a/usr.sbin/yp_mkdb/yp_mkdb.c
+++ b/usr.sbin/yp_mkdb/yp_mkdb.c
@@ -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);
OpenPOWER on IntegriCloud