aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qemu-ga.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-ga.c b/qemu-ga.c
index daeaea5461..9b59a52461 100644
--- a/qemu-ga.c
+++ b/qemu-ga.c
@@ -255,7 +255,7 @@ static bool ga_open_pidfile(const char *pidfile)
g_critical("Failed to truncate pid file");
goto fail;
}
- sprintf(pidstr, "%d", getpid());
+ snprintf(pidstr, sizeof(pidstr), "%d\n", getpid());
if (write(pidfd, pidstr, strlen(pidstr)) != strlen(pidstr)) {
g_critical("Failed to write pid file");
goto fail;