aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_core.c
diff options
context:
space:
mode:
authorKeir Fraser <keir@xensource.com>2007-10-05 14:11:36 +0100
committerKeir Fraser <keir@xensource.com>2007-10-05 14:11:36 +0100
commitf056fc9b801555fa363fb4066fdc6bad5a3b4ab8 (patch)
treee2f604321a55a8f0241d380af73ab2967d1ba52a /tools/xenstore/xenstored_core.c
parentc4698a7d71652c686f9006a32865a4fc9d20ff2d (diff)
downloadxen-f056fc9b801555fa363fb4066fdc6bad5a3b4ab8.tar.gz
xen-f056fc9b801555fa363fb4066fdc6bad5a3b4ab8.tar.bz2
xen-f056fc9b801555fa363fb4066fdc6bad5a3b4ab8.zip
xenstore: sprintf->snprintf, and fix for OpenBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'tools/xenstore/xenstored_core.c')
-rw-r--r--tools/xenstore/xenstored_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 1b9b32d67d..0ba5f05255 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -685,7 +685,7 @@ static char *perms_to_strings(const void *ctx,
char buffer[MAX_STRLEN(unsigned int) + 1];
for (*len = 0, i = 0; i < num; i++) {
- if (!xs_perm_to_string(&perms[i], buffer))
+ if (!xs_perm_to_string(&perms[i], buffer, sizeof(buffer)))
return NULL;
strings = talloc_realloc(ctx, strings, char,
@@ -1659,7 +1659,7 @@ static void write_pidfile(const char *pidfile)
if (lockf(fd, F_TLOCK, 0) == -1)
exit(0);
- len = sprintf(buf, "%ld\n", (long)getpid());
+ len = snprintf(buf, sizeof(buf), "%ld\n", (long)getpid());
if (write(fd, buf, len) != len)
barf_perror("Writing pid file %s", pidfile);
}