8193183: Fix format string in libdt_shmem/shmemBase.c

Reviewed-by: cjplummer, sspitsyn
This commit is contained in:
Christoph Langer 2017-12-08 09:48:10 +01:00
parent c30bc22a0e
commit 51cb238d81

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,6 +31,10 @@
#include "shmemBase.h"
#include "jdwpTransport.h" /* for Packet, TransportCallback */
#if defined(_WIN32)
#define PRId64 "I64d"
#endif
#define MIN(x,y) ((x)<(y)?(x):(y))
/*
@ -537,7 +541,7 @@ openConnection(SharedMemoryTransport *transport, jlong otherPID,
return SYS_NOMEM;
}
sprintf(connection->name, "%s.%ld", transport->name, sysProcessGetID());
sprintf(connection->name, "%s.%" PRId64, transport->name, sysProcessGetID());
error = sysSharedMemOpen(connection->name, &connection->sharedMemory,
&connection->shared);
if (error != SYS_OK) {
@ -601,7 +605,7 @@ createConnection(SharedMemoryTransport *transport, jlong otherPID,
return SYS_NOMEM;
}
sprintf(connection->name, "%s.%ld", transport->name, otherPID);
sprintf(connection->name, "%s.%" PRId64, transport->name, otherPID);
error = sysSharedMemCreate(connection->name, sizeof(SharedMemory),
&connection->sharedMemory, &connection->shared);
if (error != SYS_OK) {